def work(self, poll_timeout=POLL_TIMEOUT_IN_SECONDS):
    'Loop indefinitely, complete tasks from all connections.'
    continue_working = True
    worker_connections = []

    def continue_while_connections_alive(any_activity):
        return self.after_poll(any_activity)
    while continue_working:
        worker_connections = self.establish_worker_connections()
        continue_working = self.poll_connections_until_stopped(worker_connections, continue_while_connections_alive, timeout=poll_timeout)
    for current_connection in worker_connections:
        current_connection.close()
Loop indefinitely, complete tasks from all connections.
def work(self, poll_timeout=POLL_TIMEOUT_IN_SECONDS):
    
    continue_working = True
    worker_connections = []

    def continue_while_connections_alive(any_activity):
        return self.after_poll(any_activity)
    while continue_working:
        worker_connections = self.establish_worker_connections()
        continue_working = self.poll_connections_until_stopped(worker_connections, continue_while_connections_alive, timeout=poll_timeout)
    for current_connection in worker_connections:
        current_connection.close()