@@ -246,7 +246,7 @@ def __call__(self, *args: Any) -> EventSpec:
246246 msg = f"Variable `{ args [0 ]} ` cannot be set on `{ self .state_cls .get_full_name ()} `"
247247 raise AttributeError (msg )
248248
249- if asyncio .iscoroutinefunction (handler .fn ):
249+ if inspect .iscoroutinefunction (handler .fn ):
250250 msg = f"Setter for { args [0 ]} is async, which is not supported."
251251 raise NotImplementedError (msg )
252252
@@ -287,7 +287,7 @@ async def _resolve_delta(delta: Delta) -> Delta:
287287 tasks = {}
288288 for state_name , state_delta in delta .items ():
289289 for var_name , value in state_delta .items ():
290- if asyncio .iscoroutine (value ):
290+ if inspect .iscoroutine (value ):
291291 tasks [state_name , var_name ] = asyncio .create_task (
292292 value ,
293293 name = f"reflex_resolve_delta|{ state_name } |{ var_name } |{ time .time ()} " ,
@@ -1733,7 +1733,7 @@ def _is_valid_type(events: Any) -> bool:
17331733 except TypeError :
17341734 pass
17351735
1736- coroutines = [e for e in events if asyncio .iscoroutine (e )]
1736+ coroutines = [e for e in events if inspect .iscoroutine (e )]
17371737
17381738 for coroutine in coroutines :
17391739 coroutine_name = coroutine .__qualname__
@@ -1895,7 +1895,7 @@ async def _process_event(
18951895 # Wrap the function in a try/except block.
18961896 try :
18971897 # Handle async functions.
1898- if asyncio .iscoroutinefunction (fn .func ):
1898+ if inspect .iscoroutinefunction (fn .func ):
18991899 events = await fn (** payload )
19001900
19011901 # Handle regular functions.
0 commit comments