Skip to content

docs(producer): clarify SendAsync description#1485

Open
MukundaKatta wants to merge 1 commit intoapache:masterfrom
MukundaKatta:fix/sendasync-doc-clarify
Open

docs(producer): clarify SendAsync description#1485
MukundaKatta wants to merge 1 commit intoapache:masterfrom
MukundaKatta:fix/sendasync-doc-clarify

Conversation

@MukundaKatta
Copy link
Copy Markdown

Why

Closes apache/pulsar#23643.

The current Producer.SendAsync GoDoc says "This call is blocked when the maxPendingMessages becomes full (default: 1000)" without context, which makes the asynchronous API sound blocking by default. As noted in the issue thread, the call only blocks when the queue is full and DisableBlockIfQueueFull is left at its default (false). It also never says, in plain words, that the send happens in the background and the callback is what signals completion — which is the actual mental model users need.

What

pulsar/producer.go:

  • Add a one-sentence lead clarifying that SendAsync runs the send in the background and invokes the supplied callback on completion (success or failure).
  • Qualify the existing "is blocked when maxPendingMessages becomes full" sentence with the DisableBlockIfQueueFull exception, instead of describing it as unconditional.

The context paragraph, callback description, example, and signature are intentionally untouched.

Tested

  • Verified the GoDoc renders as expected by reading the diff (gh api .../compare/... shows +5 / -2 in pulsar/producer.go).
  • No code paths changed, so no test impact.

Clarify that SendAsync completes in the background and signals
completion via the user-supplied callback, and qualify the
queue-full blocking behavior with the DisableBlockIfQueueFull
option (issue apache/pulsar#23643).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Doc] Description for Producer SendAsync Needs Updating

1 participant