示例#1
0
 def update(self, state):
     """
     Set the local state of the delivery e.g. ACCEPTED, REJECTED, RELEASED.
     """
     obj2dat(self.local._data, pn_disposition_data(self.local._impl))
     obj2dat(self.local._annotations, pn_disposition_annotations(self.local._impl))
     obj2cond(self.local._condition, pn_disposition_condition(self.local._impl))
     pn_delivery_update(self._impl, state)
示例#2
0
 def update(self, state):
     """
     Set the local state of the delivery e.g. ACCEPTED, REJECTED, RELEASED.
     """
     obj2dat(self.local._data, pn_disposition_data(self.local._impl))
     obj2dat(self.local._annotations, pn_disposition_annotations(self.local._impl))
     obj2cond(self.local._condition, pn_disposition_condition(self.local._impl))
     pn_delivery_update(self._impl, state)
示例#3
0
    def update(self, state: Union[int, DispositionType]) -> None:
        """
        Set the local state of the delivery e.g. :const:`ACCEPTED`,
        :const:`REJECTED`, :const:`RELEASED`.

        :param state: State of delivery
        """
        obj2dat(self.local._data, pn_disposition_data(self.local._impl))
        obj2dat(self.local._annotations, pn_disposition_annotations(self.local._impl))
        obj2cond(self.local._condition, pn_disposition_condition(self.local._impl))
        pn_delivery_update(self._impl, state)
示例#4
0
    def annotations(self) -> Optional[Dict['symbol', 'PythonAMQPData']]:
        """The annotations associated with a disposition.

        The :class:`Data` object retrieved by this operation may be modified
        prior to updating a delivery. When a delivery is updated, the
        annotations described by the :class:`Data` are reported to the peer
        if applicable to the current delivery state, e.g. states such as
        :const:`MODIFIED`. The :class:`Data` must be empty or contain a symbol
        keyed map.

        The :class:`Data` object returned by this operation is valid until
        the parent delivery is settled.
        """
        if self.local:
            return self._annotations
        else:
            return dat2obj(pn_disposition_annotations(self._impl))
示例#5
0
 def _get_annotations(self):
     if self.local:
         return self._annotations
     else:
         return dat2obj(pn_disposition_annotations(self._impl))
示例#6
0
 def _get_annotations(self):
     if self.local:
         return self._annotations
     else:
         return dat2obj(pn_disposition_annotations(self._impl))