def __init__(self, context, backend_addr, queue_update = 10):
        """
        Init a new RRR.
        :param context: 0MQ context
        :param backend_addr: 0MQ address of the backend
        :param queue_update: interval in seconds between two updates of the distant queue. Set to something <= 0 to disable updates.
        """
        super().__init__(context, backend_addr)
        self._logger = logging.getLogger("inginious.client")
        self._available_containers = []

        self._register_handler(BackendUpdateContainers, self._handle_update_containers)
        self._register_handler(BackendGetQueue, self._handle_job_queue_update)
        self._register_transaction(ClientNewJob, BackendJobDone, self._handle_job_done, self._handle_job_abort,
                                   lambda x: x.job_id, [
                                       (BackendJobStarted, self._handle_job_started),
                                       (BackendJobSSHDebug, self._handle_job_ssh_debug)
                                   ])

        self._queue_update_timer = queue_update
        self._queue_update_last_attempt = 0              # nb of time we waited _queue_update_timer seconds for a reply
        self._queue_update_last_attempt_max = 3
        self._queue_cache = None
        self._queue_job_cache = {}
def __init__ ( self , context , backend_addr , queue_update = 10 ) : super ( ) . __init__ ( context , backend_addr ) self . _logger = logging . getLogger ( "inginious.client" ) self . _available_containers = [ ] self . _register_handler ( BackendUpdateContainers , self . _handle_update_containers ) self . _register_handler ( BackendGetQueue , self . _handle_job_queue_update ) self . _register_transaction ( ClientNewJob , BackendJobDone , self . _handle_job_done , self . _handle_job_abort , lambda x : x . job_id , [ ( BackendJobStarted , self . _handle_job_started ) , ( BackendJobSSHDebug , self . _handle_job_ssh_debug ) ] ) self . _queue_update_timer = queue_update self . _queue_update_last_attempt = 0 self . _queue_update_last_attempt_max = 3 self . _queue_cache = None self . _queue_job_cache = { }
Init a new RRR.
        :param context: 0MQ context
        :param backend_addr: 0MQ address of the backend
        :param queue_update: interval in seconds between two updates of the distant queue. Set to something <= 0 to disable updates.