Skip to content

Threading model in Pubsub client #6213

Answered by coryan
MrMoose asked this question in Q&A
Discussion options

You must be logged in to vote

I am a bit confused by the explanation of the pubsub::Subscriber behavior. Let me describe what I want to achieve first, this could make it easier:

Okay.

My client code will be executed in what I will refer to as a "main" thread. I cannot block this for long. Here I want to create a subscription and then hook up to it. Then return. I want exactly one thread spawned that is then executing the lambda for each message that is pulled. Processing the message may take between 1 and 30 seconds, after which it shall be ack'ed or nack'ed and then the next message shall be pulled.

While it is possible to configure the library to behave as-if this was happening, the current implementation uses s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MrMoose
Comment options

Answer selected by MrMoose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants