You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/11/20 03:28:06 UTC

[GitHub] [pulsar-client-go] wuYin commented on a change in pull request #394: Support sendTimeout

wuYin commented on a change in pull request #394:
URL: https://github.com/apache/pulsar-client-go/pull/394#discussion_r527370463



##########
File path: pulsar/producer.go
##########
@@ -76,6 +76,15 @@ type ProducerOptions struct {
 	// This properties will be visible in the topic stats
 	Properties map[string]string
 
+	// SendTimeout set the timeout for a message that not be acknowledged by server since sent.
+	// Send and SendAsync returns an error after timeout.
+	// Default is 30 seconds, -1 to disable.
+	SendTimeout time.Duration
+
+	// BlockIfQueueFull control whether Send and SendAsync return error if producer's message queue is full.
+	// Default is false.
+	BlockIfQueueFull bool

Review comment:
       Thanks for review.
   
   I intented to maintain the same default behavior as [client-java](https://pulsar.apache.org/docs/en/client-libraries-java/#configure-producer), but this does change the default behavior of current client-go.
   
   How about renaming `BlockIfQueueFull` to `NonBlockIfQueueFull`? just like `DisableBatching` for enable batch by default.
   
   I think the reason for doing this is, we couldn't check whether the user sets `false` explicitly or default `false`




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org