@@ -15,14 +15,14 @@ def default_handler_class_manager(HandlerCls:type,is_behavior:bool=False):
15
15
return HandlerCls ()
16
16
17
17
def extract_request_type (handler , is_behavior = False ) -> type :
18
- isfunc = inspect .isfunction (handler )
18
+ isfunc = inspect .isroutine (handler )
19
19
20
20
func = None
21
21
if isfunc :
22
22
func = handler
23
23
else :
24
24
if hasattr (handler , 'handle' ):
25
- if inspect .isfunction (handler .handle ):
25
+ if inspect .isroutine (handler .handle ):
26
26
func = handler .handle
27
27
elif inspect .ismethod (handler .handle ):
28
28
func = handler .__class__ .handle
@@ -83,7 +83,7 @@ async def send_async(self: Union["Mediator",GenericQuery[TResponse]], request: O
83
83
raise_if_handler_not_found (handler ,request )
84
84
handler_func = None
85
85
handler_obj = None
86
- if inspect .isfunction (handler ):
86
+ if inspect .isroutine (handler ):
87
87
handler_func = handler
88
88
else :
89
89
handler_obj = self1 .handler_class_manager (handler )
@@ -95,7 +95,7 @@ async def send_async(self: Union["Mediator",GenericQuery[TResponse]], request: O
95
95
async def start_func (i :int ):
96
96
beh = behaviors [i ]
97
97
beh_func = None
98
- if inspect .isfunction (beh ):
98
+ if inspect .isroutine (beh ):
99
99
beh_func = beh
100
100
else :
101
101
beh_obj = self1 .handler_class_manager (beh , True )
@@ -130,7 +130,7 @@ def send(self: Union["Mediator", GenericQuery[TResponse]], request: Optional[Gen
130
130
raise_if_handler_not_found (handler ,request )
131
131
handler_func = None
132
132
handler_obj = None
133
- if inspect .isfunction (handler ):
133
+ if inspect .isroutine (handler ):
134
134
handler_func = handler
135
135
else :
136
136
handler_obj = self1 .handler_class_manager (handler )
@@ -141,7 +141,7 @@ def send(self: Union["Mediator", GenericQuery[TResponse]], request: Optional[Gen
141
141
def start_func (i :int ):
142
142
beh = behaviors [i ]
143
143
beh_func = None
144
- if inspect .isfunction (beh ):
144
+ if inspect .isroutine (beh ):
145
145
beh_func = beh
146
146
else :
147
147
beh_obj = self1 .handler_class_manager (beh , True )
0 commit comments