pyngus/link.py
def _process_delivery(self, pn_delivery):
        """Check if the delivery can be processed."""
        if pn_delivery.readable and not pn_delivery.partial:
            data = self._pn_link.recv(pn_delivery.pending)
            msg = proton.Message()
            msg.decode(data)
            self._pn_link.advance()

            if self._handler:
                handle = "rmsg-%s:%x" % (self._name, self._next_handle)
                self._next_handle += 1
                self._unsettled_deliveries[handle] = pn_delivery
                with self._callback_lock:
                    self._handler.message_received(self, msg, handle)
            else:
                # TODO(kgiusti): is it ok to assume Delivery.REJECTED?
                pn_delivery.settle()
def _process_delivery(self, pn_delivery):
        """Check if the delivery can be processed."""
        if pn_delivery.readable and not pn_delivery.partial:
            data = self._pn_link.recv(pn_delivery.pending)
            msg = proton.Message()
            msg.decode(data)
            self._pn_link.advance()

            if self._handler:
                handle = "rmsg-%s:%x" % (self._name, self._next_handle)
                self._next_handle += 1
                self._unsettled_deliveries[handle] = pn_delivery
                with self._callback_lock:
                    self._handler.message_received(self, msg, handle)
            else:
                # TODO(kgiusti): is it ok to assume Delivery.REJECTED?
                pn_delivery.settle()
def _process_delivery ( self , pn_delivery ) : if pn_delivery . readable and not pn_delivery . partial : data = self . _pn_link . recv ( pn_delivery . pending ) msg = proton . Message ( ) msg . decode ( data ) self . _pn_link . advance ( ) if self . _handler : handle = "rmsg-%s:%x" % ( self . _name , self . _next_handle ) self . _next_handle += 1 self . _unsettled_deliveries [ handle ] = pn_delivery with self . _callback_lock : self . _handler . message_received ( self , msg , handle ) else : # TODO(kgiusti): is it ok to assume Delivery.REJECTED? pn_delivery . settle ( )
Check if the delivery can be processed.
Check if the delivery can be processed .