This is a cool idea and doing this might actually not be too difficult. The 
main pieces to get this working are likely:

  * Calling Nim's async event loop from Python's periodically
  * Interoperability between Nim's futures and Python's (not strictly 
necessary, but would allow awaiting Nim's async procs in Python which would be 
pretty nice)



I know that it is possible to ask epoll to let you know when another epoll FD 
is ready to be polled. Python should allow you to add arbitrary FDs to its 
event loop in order to receive readable/writeable events on it, you can then 
grab Nim's asyncdispatcher's FD and ask Python to tell when it should be 
polled. Then simply poll it. I take this approach in my HTTP server: 
[https://github.com/dom96/httpbeast/blob/master/src/httpbeast.nim#L168-L171](https://github.com/dom96/httpbeast/blob/master/src/httpbeast.nim#L168-L171).

Happy to help further if you're interested in pursuing this.

Reply via email to