From 40ffb42f0f7044c82f01d779a496f23cb14f5577 Mon Sep 17 00:00:00 2001 From: Jonathan Amsterdam Date: Wed, 9 Aug 2017 09:54:29 -0400 Subject: [PATCH] pubsub: clarify doc for ReceiveSettings.NumGoroutines Fixes #712. Change-Id: I0c28081933c35ed3f2baf1617f39a2f92c7fd552 Reviewed-on: https://code-review.googlesource.com/15690 Reviewed-by: kokoro Reviewed-by: Michael Darakananda --- pubsub/subscription.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pubsub/subscription.go b/pubsub/subscription.go index e179143d8af..f59f991efda 100644 --- a/pubsub/subscription.go +++ b/pubsub/subscription.go @@ -152,6 +152,12 @@ type ReceiveSettings struct { // NumGoroutines is the number of goroutines Receive will spawn to pull // messages concurrently. If NumGoroutines is less than 1, it will be treated // as if it were DefaultReceiveSettings.NumGoroutines. + // + // NumGoroutines does not limit the number of messages that can be processed + // concurrently. Even with one goroutine, many messages might be processed at + // once, because that goroutine may continually receive messages and invoke the + // function passed to Receive on them. To limit the number of messages being + // processed concurrently, set MaxOutstandingMessages. NumGoroutines int }