You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by cl...@apache.org on 2020/08/07 00:03:53 UTC
[qpid-proton] branch master updated: PROTON-2258: mark
pn_work_head(), pn_work_next(), and Python equivalents as deprecated.
This is an automated email from the ASF dual-hosted git repository.
cliffjansen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git
The following commit(s) were added to refs/heads/master by this push:
new ee88029 PROTON-2258: mark pn_work_head(), pn_work_next(), and Python equivalents as deprecated.
ee88029 is described below
commit ee880294923cdf81a0f693282dde6df1e320b599
Author: Cliff Jansen <cl...@apache.org>
AuthorDate: Thu Aug 6 17:03:03 2020 -0700
PROTON-2258: mark pn_work_head(), pn_work_next(), and Python equivalents as deprecated.
---
c/include/proton/delivery.h | 2 ++
c/src/core/engine.c | 5 +++++
python/cproton.i | 4 ++++
python/proton/_delivery.py | 4 +++-
python/proton/_endpoints.py | 4 +++-
5 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/c/include/proton/delivery.h b/c/include/proton/delivery.h
index ec034e9..118fbf6 100644
--- a/c/include/proton/delivery.h
+++ b/c/include/proton/delivery.h
@@ -328,6 +328,7 @@ PN_EXTERN bool pn_delivery_buffered(pn_delivery_t *delivery);
* @return the first delivery object that needs to be serviced, else
* NULL if none
*/
+PN_DEPRECATED("Use the PN_DELIVERY event to track deliveries with pending operations")
PN_EXTERN pn_delivery_t *pn_work_head(pn_connection_t *connection);
/**
@@ -339,6 +340,7 @@ PN_EXTERN pn_delivery_t *pn_work_head(pn_connection_t *connection);
* @return the next delivery that has pending operations, else
* NULL if none
*/
+PN_DEPRECATED("Use the PN_DELIVERY event to track deliveries with pending operations")
PN_EXTERN pn_delivery_t *pn_work_next(pn_delivery_t *delivery);
/**
diff --git a/c/src/core/engine.c b/c/src/core/engine.c
index 02062f6..e1a6610 100644
--- a/c/src/core/engine.c
+++ b/c/src/core/engine.c
@@ -19,6 +19,9 @@
*
*/
+/* for pn_work_head and related deprecations */
+#define PN_USE_DEPRECATED_API 1
+
#include "engine-internal.h"
#include "framing.h"
@@ -2407,3 +2410,5 @@ const char *pn_disposition_type_name(uint64_t d) {
default: return "unknown";
}
}
+
+#undef PN_USE_DEPRECATED_API
diff --git a/python/cproton.i b/python/cproton.i
index 0dcc2ce..2a7bff9 100644
--- a/python/cproton.i
+++ b/python/cproton.i
@@ -22,6 +22,10 @@
#if defined(_WIN32) && ! defined(__CYGWIN__)
#include <winsock2.h>
#endif
+
+/* TODO: Remove once pn_work_head() and related have been removed from Proton */
+#define PN_USE_DEPRECATED_API 1
+
#include <proton/engine.h>
#include <proton/message.h>
#include <proton/object.h>
diff --git a/python/proton/_delivery.py b/python/proton/_delivery.py
index f5c955f..0f871cf 100644
--- a/python/proton/_delivery.py
+++ b/python/proton/_delivery.py
@@ -445,7 +445,9 @@ class Delivery(Wrapper):
@property
def work_next(self):
- """
+ """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.
diff --git a/python/proton/_endpoints.py b/python/proton/_endpoints.py
index 50cf677..e528de6 100644
--- a/python/proton/_endpoints.py
+++ b/python/proton/_endpoints.py
@@ -472,7 +472,9 @@ class Connection(Wrapper, Endpoint):
@property
def work_head(self):
- """
+ """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.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org