zeronimo/core.py
def _call_wait(self, hints, name, args, kwargs, topics=(), raw=False,
                   limit=None, retry=False, max_retries=None):
        """Allocates a call id and emit."""
        col = self.collector
        if not col.is_running():
            col.start()
        call_id = uuid4_bytes()
        reply_to = (DUPLEX if self.socket is col.socket else col.topic)
        # Normal tuple is faster than namedtuple.
        header = self._make_header(name, call_id, reply_to, hints)
        payload = self._pack(args, kwargs, raw)
        # Use short names.
        def send_call():
            try:
                safe(send, self.socket, header, payload, topics, zmq.NOBLOCK)
            except zmq.Again:
                raise Undelivered('emission was not delivered')
        col.prepare(call_id, self, name, args, kwargs)
        send_call()
        return col.establish(call_id, self.timeout, limit,
                             send_call if retry else None,
                             max_retries=max_retries)
def _call_wait(self, hints, name, args, kwargs, topics=(), raw=False,
                   limit=None, retry=False, max_retries=None):
        col = self.collector
        if not col.is_running():
            col.start()
        call_id = uuid4_bytes()
        reply_to = (DUPLEX if self.socket is col.socket else col.topic)
        # Normal tuple is faster than namedtuple.
        header = self._make_header(name, call_id, reply_to, hints)
        payload = self._pack(args, kwargs, raw)
        # Use short names.
        def send_call():
            try:
                safe(send, self.socket, header, payload, topics, zmq.NOBLOCK)
            except zmq.Again:
                raise Undelivered('emission was not delivered')
        col.prepare(call_id, self, name, args, kwargs)
        send_call()
        return col.establish(call_id, self.timeout, limit,
                             send_call if retry else None,
                             max_retries=max_retries)
def _call_wait ( self , hints , name , args , kwargs , topics = ( ) , raw = False , limit = None , retry = False , max_retries = None ) : col = self . collector if not col . is_running ( ) : col . start ( ) call_id = uuid4_bytes ( ) reply_to = ( DUPLEX if self . socket is col . socket else col . topic ) # Normal tuple is faster than namedtuple. header = self . _make_header ( name , call_id , reply_to , hints ) payload = self . _pack ( args , kwargs , raw ) # Use short names. def send_call ( ) : try : safe ( send , self . socket , header , payload , topics , zmq . NOBLOCK ) except zmq . Again : raise Undelivered ( 'emission was not delivered' ) col . prepare ( call_id , self , name , args , kwargs ) send_call ( ) return col . establish ( call_id , self . timeout , limit , send_call if retry else None , max_retries = max_retries )
Allocates a call id and emit.
Allocates a call id and emit .