Open aur3l14no opened 2 years ago
I am not sure that using python's async system with Clojure's async system will ever work as you expect. The issue is that Clojure's async system is going to run code in an arbitrary thread and then Python's async system won't have the event loop accessible from that thread.
If you want to use python's async system I think often you will want to launch Clojure from Python in embedded mode to make sure the Python async system is running in the context that it expects. This is similar to python multithreading - because the JVM takes control of the process the python multithreading system can only be used from embedded mode.
Huge thanks for the great library. I'm wondering if the following is possible.
The problem
I want to call python functions with
asyncio.get_event_loop()
inside go blocks.The
get_event_loop
is buried deep in the python code base, so I can't simply swap every required event loop to some new event loop that I create.I haven't come up with a way to write a wrapper, and setting the event loop manually does not help.
I'm not seeking to solve the exception, because I think my approach seems wrong and the exception is expected, but rather, I'm asking for a way for my goal.
Many Thanks!
A minimal example that crashes
will raise an exception