Skip to content

Commit 8584108

Browse files
authored
Revert some of the thread safe changes (#133)
1 parent b982f95 commit 8584108

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/mp_actors/move.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,12 @@ async def async_method_wrapper(*args: Any, **kwargs: Any) -> Any:
148148
# Return a regular function wrapper
149149
@streamline_tracebacks()
150150
def method_wrapper(*args: Any, **kwargs: Any) -> Any:
151-
loop = asyncio.get_event_loop()
152-
if loop.is_running():
153-
fut = asyncio.run_coroutine_threadsafe(get_response(args, kwargs), loop)
154-
return fut.result()
155-
else:
156-
return asyncio.run(get_response(args, kwargs))
151+
return asyncio.run(get_response(args, kwargs))
157152

158153
return method_wrapper
159154
else:
160-
return asyncio.run(get_response(tuple(), {}))
155+
# For non-callable attributes, get them directly
156+
return asyncio.run(get_response(tuple(), dict()))
161157

162158
def close(self):
163159
# signal the response loop to exit

0 commit comments

Comments
 (0)