This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit ffafc34fcb6523876bac4059203981fe1aa94ad6
Author: Andrew Stitcher <astitc...@apache.org>
AuthorDate: Thu Dec 1 17:09:31 2022 -0500

    PROTON-2674: Remove deprecated pn_work APIs and python tests
---
 python/proton/_delivery.py          | 12 +-----------
 python/proton/_endpoints.py         | 23 +----------------------
 python/tests/proton_tests/engine.py | 31 -------------------------------
 3 files changed, 2 insertions(+), 64 deletions(-)

diff --git a/python/proton/_delivery.py b/python/proton/_delivery.py
index 3badb565e..40143c286 100644
--- a/python/proton/_delivery.py
+++ b/python/proton/_delivery.py
@@ -24,7 +24,7 @@ from cproton import PN_ACCEPTED, PN_MODIFIED, PN_RECEIVED, 
PN_REJECTED, PN_RELEA
     pn_delivery_writable, pn_disposition_annotations, 
pn_disposition_condition, pn_disposition_data, \
     pn_disposition_get_section_number, pn_disposition_get_section_offset, 
pn_disposition_is_failed, \
     pn_disposition_is_undeliverable, pn_disposition_set_failed, 
pn_disposition_set_section_number, \
-    pn_disposition_set_section_offset, pn_disposition_set_undeliverable, 
pn_disposition_type, pn_work_next
+    pn_disposition_set_section_offset, pn_disposition_set_undeliverable, 
pn_disposition_type
 
 from ._condition import cond2obj, obj2cond
 from ._data import dat2obj, obj2dat
@@ -401,16 +401,6 @@ class Delivery(Wrapper):
         """
         pn_delivery_abort(self._impl)
 
-    @property
-    def work_next(self) -> Optional['Delivery']:
-        """Deprecated: use on_message(), on_accepted(), on_rejected(),
-        on_released(), and on_settled() instead.
-
-        The next :class:`Delivery` on the connection that has pending
-        operations.
-        """
-        return Delivery.wrap(pn_work_next(self._impl))
-
     @property
     def link(self) -> Union['Receiver', 'Sender']:
         """
diff --git a/python/proton/_endpoints.py b/python/proton/_endpoints.py
index a427d7471..d2064bd93 100644
--- a/python/proton/_endpoints.py
+++ b/python/proton/_endpoints.py
@@ -53,7 +53,7 @@ from cproton import PN_CONFIGURATION, PN_COORDINATOR, 
PN_DELIVERIES, PN_DIST_MOD
     pn_terminus_get_durability, pn_terminus_get_expiry_policy, 
pn_terminus_get_timeout, pn_terminus_get_type, \
     pn_terminus_is_dynamic, pn_terminus_outcomes, pn_terminus_properties, 
pn_terminus_set_address, \
     pn_terminus_set_distribution_mode, pn_terminus_set_durability, 
pn_terminus_set_dynamic, \
-    pn_terminus_set_expiry_policy, pn_terminus_set_timeout, 
pn_terminus_set_type, pn_work_head, \
+    pn_terminus_set_expiry_policy, pn_terminus_set_timeout, 
pn_terminus_set_type, \
     pn_link_properties, pn_link_remote_properties
 
 from ._common import unicode2utf8, utf82unicode
@@ -465,27 +465,6 @@ class Connection(Wrapper, Endpoint):
         """
         return Link.wrap(pn_link_head(self._impl, mask))
 
-    @property
-    def work_head(self) -> Optional[Delivery]:
-        """Deprecated: use on_message(), on_accepted(), on_rejected(),
-        on_released(), and on_settled() instead.
-
-        Extracts the first delivery on the connection that has pending
-        operations.
-
-        Retrieves the first delivery on the Connection that has pending
-        operations. A readable delivery indicates message data is waiting
-        to be read. A writable delivery indicates that message data may be
-        sent. An updated delivery indicates that the delivery's disposition
-        has changed. A delivery will never be both readable and writable,
-        but it may be both readable and updated or both writable and
-        updated.
-
-        :return: The first delivery object that needs to be serviced, or 
``None`` if none.
-        :rtype: :class:`Delivery` or ``None``
-        """
-        return Delivery.wrap(pn_work_head(self._impl))
-
     @property
     def error(self):
         """
diff --git a/python/tests/proton_tests/engine.py 
b/python/tests/proton_tests/engine.py
index b9590a2b2..f7a0685b4 100644
--- a/python/tests/proton_tests/engine.py
+++ b/python/tests/proton_tests/engine.py
@@ -844,28 +844,6 @@ class TransferTest(Test):
         gc.collect()
         assert not gc.garbage
 
-    def test_work_queue(self):
-        assert self.c1.work_head is None
-        self.snd.delivery("tag")
-        assert self.c1.work_head is None
-        self.rcv.flow(1)
-        self.pump()
-        d = self.c1.work_head
-        assert d is not None
-        tag = d.tag
-        assert tag == "tag", tag
-        assert d.writable
-
-        n = self.snd.send(b"this is a test")
-        assert self.snd.advance()
-        assert self.c1.work_head is None
-
-        self.pump()
-
-        d = self.c2.work_head
-        assert d.tag == "tag"
-        assert d.readable
-
     def test_multiframe(self):
         self.rcv.flow(1)
         self.snd.delivery("tag")
@@ -1031,15 +1009,6 @@ class TransferTest(Test):
             assert n == len(msg)
             assert self.snd.advance()
 
-        # handle all disposition changes to sent messages
-        d = self.c1.work_head
-        while d:
-            next_d = d.work_next
-            if d.updated:
-                d.update(Delivery.ACCEPTED)
-                d.settle()
-            d = next_d
-
         # submit some more deliveries
         for m in range(1450, 1500):
             sd = self.snd.delivery("tag%s" % m)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to