Skip to content

Commit c6f4820

Browse files
ndyakovCopilot
andauthored
Update pubsub.go
Co-authored-by: Copilot <[email protected]>
1 parent 5649ffb commit c6f4820

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pubsub.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,12 @@ func (c *PubSub) ReceiveTimeout(ctx context.Context, timeout time.Duration) (int
493493
// Receive returns a message as a Subscription, Message, Pong or error.
494494
// See PubSub example for details. This is low-level API and in most cases
495495
// Channel should be used instead.
496-
// This will block until a message is received.
496+
// Receive returns a message as a Subscription, Message, Pong, or an error.
497+
// See PubSub example for details. This is a low-level API and in most cases
498+
// Channel should be used instead.
499+
// This method blocks until a message is received or an error occurs.
500+
// It may return early with an error if the context is canceled, the connection fails,
501+
// or other internal errors occur.
497502
func (c *PubSub) Receive(ctx context.Context) (interface{}, error) {
498503
return c.ReceiveTimeout(ctx, 0)
499504
}

0 commit comments

Comments
 (0)