Refactorizes reactor.ReactorWorker.worker_loop()