Allow handlers to return extra work to the scheduler.

This commit is contained in:
Ralph Bean
2016-10-29 15:55:06 -04:00
parent b35b7d9577
commit fdb735de44

View File

@@ -157,8 +157,11 @@ class MessageWorker(threading.Thread):
log.debug("Handler is NO_OP: %s" % idx)
else:
log.info("Calling %s" % idx)
handler(conf, session, msg)
further_work = handler(conf, session, msg) or []
log.info("Done with %s" % idx)
for event in further_work:
log.info(" Scheduling faked event %r" % event)
self.incoming_work_queue.put(event)
class Poller(threading.Thread):