Skip to content

Commit 080419e

Browse files
committed
chg: [connection] put sync callback in threads
1 parent 373383a commit 080419e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

realtime/connection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ async def _run_callback_safe(self, callback: Callback, payload: Dict) -> None:
7979
if asyncio.iscoroutinefunction(callback):
8080
asyncio.create_task(callback(payload))
8181
else:
82-
callback(payload)
82+
asyncio.create_task(asyncio.to_thread(callback, payload))
8383
except Exception as e:
8484
raise CallbackError("Error in callback") from e
8585

0 commit comments

Comments
 (0)