I use celery for doing snmp requests with easysnmp library which have a C interface. The problem is lots of time is being wasted on I/O. I know that I should use eventlet or gevent in this kind of situations, but I don't know how to handle patching a third party library when it uses C extensions.
Asked
Active
Viewed 374 times
1 Answers
1
Eventlet and gevent can't monkey-patch C code.
You can offload blocking calls to OS threads with eventlet.tpool.execute(library.io_func)

temoto
- 5,394
- 3
- 34
- 50