Skip to content

PubSub: Force push a batch of messages #9906

@hnykda

Description

@hnykda

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:

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the Pub/Sub API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions