Saturday, 15 March 2014

python - Block execution until condition -



python - Block execution until condition -

i using eventlet , have 2 main process running. 1 of process acts producer , other consumer. problem instead of using queue eventlet bundle want utilize db. using queue can simple pass (block=true) argument , eventlet take care of bloking execution of consumer routine untill producer puts in queue. if replace queue db how efficiently implement blocking logic.

look info in db every n seconds. if nil found - sleep.

update: or utilize postgresql listen/notify mechanism shown in http://initd.org/psycopg/articles/2010/12/01/postgresql-notifications-psycopg2-eventlet/

python multithreading python-2.7 python-3.x eventlet

No comments:

Post a Comment