def __init__(self, messaging, client_defer, factory): StateMachineMixin.__init__(self, ChannelState.recording) log.Logger.__init__(self, messaging) log.LogProxy.__init__(self, messaging) self.channel = None self.client = None self.factory = factory self._queues = [] self._is_processing = False self._processing_chain = [] self._seen_messages = container.ExpDict(self) # holds list of messages to send in case we are disconnected self._to_send = container.ExpQueue(self, max_size=50) self._notifier = defer.Notifier() # RabbitMQ behaviour for creating/deleting bindings has a following # issue: if you call create binding two times, and than delete ones # there will be no binding. This is a problem for us if two agents # create the same binding (public interest) and than one of them # deletes is. We need to count the number of creates/deletes to delete # the binding only when there is no more agents using it self._bindings_count = dict() self.serializer = banana.Serializer() self.unserializer = banana.Unserializer() client_defer.addCallback(self._setup_with_client)
def __init__(self, logger, *args, **kwargs): log.LogProxy.__init__(self, logger) log.Logger.__init__(self, logger) StateMachineMixin.__init__(self, ProcessState.initiated) self.config = dict() self.args = list() self.command = None self.env = dict() self._control = None self.initiate(*args, **kwargs) self.validate_setup()
def __init__(self, messaging, client_defer, factory): StateMachineMixin.__init__(self, ChannelState.recording) log.Logger.__init__(self, messaging) log.LogProxy.__init__(self, messaging) self.channel = None self.client = None self.factory = factory self._queues = [] self._processing_chain = [] self.serializer = banana.Serializer() self.unserializer = banana.Unserializer() client_defer.addCallback(self._setup_with_client)
def __init__(self, call, *args): StateMachineMixin.__init__(self, "waiting") self.value = None d = call(*args) d.addCallback(self._store)