Skip to content

Commit

Permalink
feat(pubsub): deprecate synchronous mode (#5910)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongalex authored Apr 26, 2022
1 parent ee44bf6 commit bda5179
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions pubsub/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,20 @@ type ReceiveSettings struct {
// processed concurrently, set MaxOutstandingMessages.
NumGoroutines int

// If Synchronous is true, then no more than MaxOutstandingMessages will be in
// memory at one time. (In contrast, when Synchronous is false, more than
// MaxOutstandingMessages may have been received from the service and in memory
// before being processed.) MaxOutstandingBytes still refers to the total bytes
// processed, rather than in memory. NumGoroutines is ignored.
// Synchronous switches the underlying receiving mechanism to unary Pull.
// When Synchronous is false, the more performant StreamingPull is used.
// StreamingPull also has the benefit of subscriber affinity when using
// ordered delivery.
// When Synchronous is true, NumGoroutines is set to 1 and only one Pull
// RPC will be made to poll messages at a time.
// The default is false.
//
// Deprecated.
// Previously, users might use Synchronous mode since StreamingPull had a limitation
// where MaxOutstandingMessages was not always respected with large batches of
// small messsages. With server side flow control, this is no longer an issue
// and we recommend switching to the default StreamingPull mode by setting
// Synchronous to false.
Synchronous bool
}

Expand Down

0 comments on commit bda5179

Please sign in to comment.