@@ -15,14 +15,14 @@ def default_handler_class_manager(HandlerCls:type,is_behavior:bool=False):
1515 return HandlerCls ()
1616
1717def extract_request_type (handler , is_behavior = False ) -> type :
18- isfunc = inspect .isfunction (handler )
18+ isfunc = inspect .isroutine (handler )
1919
2020 func = None
2121 if isfunc :
2222 func = handler
2323 else :
2424 if hasattr (handler , 'handle' ):
25- if inspect .isfunction (handler .handle ):
25+ if inspect .isroutine (handler .handle ):
2626 func = handler .handle
2727 elif inspect .ismethod (handler .handle ):
2828 func = handler .__class__ .handle
@@ -83,7 +83,7 @@ async def send_async(self: Union["Mediator",GenericQuery[TResponse]], request: O
8383 raise_if_handler_not_found (handler ,request )
8484 handler_func = None
8585 handler_obj = None
86- if inspect .isfunction (handler ):
86+ if inspect .isroutine (handler ):
8787 handler_func = handler
8888 else :
8989 handler_obj = self1 .handler_class_manager (handler )
@@ -95,7 +95,7 @@ async def send_async(self: Union["Mediator",GenericQuery[TResponse]], request: O
9595 async def start_func (i :int ):
9696 beh = behaviors [i ]
9797 beh_func = None
98- if inspect .isfunction (beh ):
98+ if inspect .isroutine (beh ):
9999 beh_func = beh
100100 else :
101101 beh_obj = self1 .handler_class_manager (beh , True )
@@ -130,7 +130,7 @@ def send(self: Union["Mediator", GenericQuery[TResponse]], request: Optional[Gen
130130 raise_if_handler_not_found (handler ,request )
131131 handler_func = None
132132 handler_obj = None
133- if inspect .isfunction (handler ):
133+ if inspect .isroutine (handler ):
134134 handler_func = handler
135135 else :
136136 handler_obj = self1 .handler_class_manager (handler )
@@ -141,7 +141,7 @@ def send(self: Union["Mediator", GenericQuery[TResponse]], request: Optional[Gen
141141 def start_func (i :int ):
142142 beh = behaviors [i ]
143143 beh_func = None
144- if inspect .isfunction (beh ):
144+ if inspect .isroutine (beh ):
145145 beh_func = beh
146146 else :
147147 beh_obj = self1 .handler_class_manager (beh , True )
0 commit comments