Skip to content

How to keep subscriber active and listen for new messages #494

Answered by jmklix
datahack336 asked this question in Q&A
Discussion options

You must be logged in to vote

@github-actions proposed-answer
You could just use a threading event wait like we do in the pubsub sample:

received_all_event.wait()

You don't need to use a while True because the on_message_received is handled in another thread. What your doing also looks fine, but the choice is up to you to decided how you handle this. Please let us know if you have any other questions about this sdk.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@github-actions
Comment options

@datahack336
Comment options

Answer selected by datahack336
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
attention This discussion needs attention.

2 participants