Support for gevent?

From @bobh66 on Wed Jul 26 2017 20:54:37 GMT+0000 (UTC)

Has there been any interest in supporting gevent in addition to eventlet?

I need to create a dependency on some code that already uses gevent and monkey_patching, so combining it with eventlet monkey_patching doesn’t work too well.

I’d like to abstract the eventlet interface so that a different loop type can be specified, either in config or explicitly, and the appropriate underlying methods would handle the event/timeout/etc processing.

Or is there an easier way to handle this dependency?

Thanks

Copied from original issue: https://github.com/nameko/nameko/issues/460

From @mattbennett on Thu Jul 27 2017 13:11:34 GMT+0000 (UTC)

Gevent is not a drop-in replacement for eventlet unfortunately, and we make heavy use of some eventlet features that have no equivalent, such as the Event object. An abstracted concurrency interface is a nice idea in theory, but it would take some work to implement.

Unfortunately I don’t think there’s a lot that can be done to stitch two libraries that are bound to different event loops together. For a quick win I think your best bet is to put your gevent dependency in a separate process and give it a network interface that your nameko service can treat as the dependency.