Skip to content
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

PubSub: Force push a batch of messages #9906

Closed
hnykda opened this issue Dec 2, 2019 · 3 comments
Closed

PubSub: Force push a batch of messages #9906

hnykda opened this issue Dec 2, 2019 · 3 comments
Assignees
Labels
api: pubsub Issues related to the Pub/Sub API. type: question Request for information or clarification. Not an issue.

Comments

@hnykda
Copy link

hnykda commented Dec 2, 2019

Is your feature request related to a problem? Please describe.
Hi,

I have a simple publish for loop:

for message in data:
        future = publisher.publish(topic_path, data=message)
        future.add_done_callback(self.get_callback(future, message))

with some callback (-> I don't wait until the future is returned). The problem is that when the last batch of data is being created, the process terminates earlier than it's being sent (<MAX_LATENCY), missing some last messages.

Could there be a way of something like publisher.join() or publisher.force_push() to make sure that all messages are sent before the process terminates?

Related:

@plamut plamut changed the title Force push a batch of messages PubSub: Force push a batch of messages Dec 2, 2019
@plamut plamut added api: pubsub Issues related to the Pub/Sub API. type: question Request for information or clarification. Not an issue. labels Dec 2, 2019
@plamut
Copy link
Contributor

plamut commented Dec 2, 2019

@hnykda This sounds like the issue #6883, which was addressed in #9365, but it has not been released yet.

If feasible, could you try installing the latest development version of the PubSub client and try it out? The new publisher.stop() method should achieve the desired.

@hnykda
Copy link
Author

hnykda commented Dec 3, 2019

Hi! Yes, it's exactly that, sorry for missing that one out when searching for similarities.

Will try. Any ideas when the next release could be out?

@plamut
Copy link
Contributor

plamut commented Dec 3, 2019

@hnykda No date yet, but I will propose to make it sooner rather than later. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants