Replies: 1 comment 3 replies
-
Stream/Consumer management methods accept As for Furthermore, we did not want to add context on |
Beta Was this translation helpful? Give feedback.
-
Stream/Consumer management methods accept As for Furthermore, we did not want to add context on |
Beta Was this translation helpful? Give feedback.
-
To follow the pattern of starting something and then defer a something.Close(), is the only option available in the new api; consumer.Consume() with the special returned consumContext that is not a context and exposes a single Stop menthod?
It would be more intuitive to give it a context and cancel it to make it stop. But that would (?) break the use of context to cancel the api-method itself.
But it raises the question, what is it the context actually cancel? In what situation do we expect to cancel a AddConsumer's progress? Or the DeleteConsumer. If i cancel the AddConsumer, what happens if the consumer actually is created but i havent yet received the ack from the server? Will it get removed again? Maybe the error will be context.Cancelled, but does that mean everything the the method may do is not done (like a transactional rollback). Or is there any api-calls that do more than one thing and cancelling them may leave us in an uncertain state?
I absolutly agree using ctx on Fetch and similar things expected to take time where a partial answer might be acceptable. Also in publish since quorum/persisting may take longer than expected. But I cannot really understand it's use in calls like AddStream, PublishAsync, AddConsumer, input parameter in Consume, DeleteConsumer.
Can anyone help me understand better? Am I missunderstanding the concept of context (to stop lengthy operations when there reason to do the operation was removed)?
Beta Was this translation helpful? Give feedback.
All reactions