-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pulsar-client] Add deliver_at and deliver_after to python client #6737
Merged
merlimat
merged 6 commits into
apache:master
from
yciabaud:delayed-delivering-python-head
Apr 15, 2020
Merged
[pulsar-client] Add deliver_at and deliver_after to python client #6737
merlimat
merged 6 commits into
apache:master
from
yciabaud:delayed-delivering-python-head
Apr 15, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create a new function deliverAfter that takes the MessageBuilder and a py::object. Python object is reinterpreted as PyDateTime_Delta then convert to a std::chrono::duration and then the builder property is setted. After that we return the builder. Signed-off-by: Guillaume Perrin <[email protected]>
Use PyObject* instead of boost::python::api::object since we want to cast to another python object, PyDateTime_Delta. Signed-off-by: Guillaume Perrin <[email protected]>
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
sijie
added
the
type/feature
The PR added a new feature or issue requested a new feature
label
Apr 14, 2020
merlimat
approved these changes
Apr 15, 2020
jerrypeng
pushed a commit
to jerrypeng/incubator-pulsar
that referenced
this pull request
May 15, 2020
…ache#6737) * Add deliver_at and deliver_after to python client * Fix deliver_at test * Fix deliver_after function binding for Python Create a new function deliverAfter that takes the MessageBuilder and a py::object. Python object is reinterpreted as PyDateTime_Delta then convert to a std::chrono::duration and then the builder property is setted. After that we return the builder. Signed-off-by: Guillaume Perrin <[email protected]> * Fix cast of datetime in setDeliverAfter in python library Use PyObject* instead of boost::python::api::object since we want to cast to another python object, PyDateTime_Delta. Signed-off-by: Guillaume Perrin <[email protected]> * Fix test comment * Remove unused import Co-authored-by: Yoann Ciabaud <[email protected]> Co-authored-by: Guillaume Perrin <[email protected]>
huangdx0726
pushed a commit
to huangdx0726/pulsar
that referenced
this pull request
Aug 24, 2020
…ache#6737) * Add deliver_at and deliver_after to python client * Fix deliver_at test * Fix deliver_after function binding for Python Create a new function deliverAfter that takes the MessageBuilder and a py::object. Python object is reinterpreted as PyDateTime_Delta then convert to a std::chrono::duration and then the builder property is setted. After that we return the builder. Signed-off-by: Guillaume Perrin <[email protected]> * Fix cast of datetime in setDeliverAfter in python library Use PyObject* instead of boost::python::api::object since we want to cast to another python object, PyDateTime_Delta. Signed-off-by: Guillaume Perrin <[email protected]> * Fix test comment * Remove unused import Co-authored-by: Yoann Ciabaud <[email protected]> Co-authored-by: Guillaume Perrin <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Delayed message delivery is available in C++ client but not in Python client, as a Python client user, I would like to benefit from this feature as well.
Modifications
Update of the C++ messagebuilder Python binding to expose
deliver_at
anddeliver_after
to the Python API.Update of the Python client to add these features to the producer sending method.
Verifying this change
This change added tests and can be verified as follows:
deliver_at
anddeliver_after
Does this pull request potentially affect one of the following parts:
This PR affects the python public API with new parameters for python producer
send
andsendAsync
methodsdeliver_at
anddeliver_after
.Documentation
This feature is documented in the python source code.