1

We have an existing codebase that is heavily Thread based which we're trying to expose through flask-socketio. I can't find a mechanism to have a greenlet wait for data from a Thread without blocking all of gevent or through a polling loop.

I thought maybe I could use an unbounded gevent Queue and call put from the Thread but that didn't seem to work. Also, the application is not performant enough with long polling so we can't use threads for socketio.

Is there a mechanism to receive data from the Thread in a greenlet without the greenlet blocking all of gevent?

Damon Maria
  • 1,001
  • 1
  • 8
  • 21
  • Did you look at: https://stackoverflow.com/questions/9192539/using-gevent-monkey-patching-with-threading-makes-thread-work-serially – Maurice Meyer Dec 24 '22 at 23:25
  • @MauriceMeyer Do you mean monkey patching threads with gevent? The threaded code we have definitely needs multiple cores. It's highly unlikely it would work with monkey patching or gevent. – Damon Maria Dec 26 '22 at 00:51

0 Answers0