jayshrivastava commented on code in PR #1165:
URL: https://github.com/apache/pulsar-client-go/pull/1165#discussion_r1473611377


##########
pulsar/producer.go:
##########
@@ -239,7 +239,7 @@ type Producer interface {
 
        // Flush all the messages buffered in the client and wait until all 
messages have been successfully
        // persisted.
-       Flush() error
+       Flush(ctx context.Context) error

Review Comment:
   Just pushed an update. Lmk how it looks!
   
   Btw, do you know if the library will support shutting down via context 
cancellation  in the future? There's some examples of where we don't do it:
   
   
https://github.com/apache/pulsar-client-go/blob/efd9806be9aec8a7ec0e602664bd7dd008822627/pulsar/producer_partition.go#L491
   
   
https://github.com/apache/pulsar-client-go/blob/efd9806be9aec8a7ec0e602664bd7dd008822627/pulsar/producer_partition.go#L1470-L1481
   
   As long as things don't take too long to shut down, I suppose it's fine. 
Ideally, if the context is cancelled, you don't want to wait for a 
clean/graceful shutdown where we wait for the done channel. We want all the 
goroutines to terminate right where they are and immediately returned.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to