From c6f4820a96b6b5d0dba68a2b4bd5ea22b2408686 Mon Sep 17 00:00:00 2001 From: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com> Date: Tue, 19 Aug 2025 15:38:16 +0300 Subject: [PATCH] Update pubsub.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pubsub.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pubsub.go b/pubsub.go index 01188d10..6db13a9a 100644 --- a/pubsub.go +++ b/pubsub.go @@ -493,7 +493,12 @@ func (c *PubSub) ReceiveTimeout(ctx context.Context, timeout time.Duration) (int // Receive returns a message as a Subscription, Message, Pong or error. // See PubSub example for details. This is low-level API and in most cases // Channel should be used instead. -// This will block until a message is received. +// Receive returns a message as a Subscription, Message, Pong, or an error. +// See PubSub example for details. This is a low-level API and in most cases +// Channel should be used instead. +// This method blocks until a message is received or an error occurs. +// It may return early with an error if the context is canceled, the connection fails, +// or other internal errors occur. func (c *PubSub) Receive(ctx context.Context) (interface{}, error) { return c.ReceiveTimeout(ctx, 0) }