Skip to content

feat: add configurable timeouts for emitters - #17

Draft
kahirokunn wants to merge 2 commits into
split/emitter-retryfrom
split/emitter-timeout-after-retry
Draft

kahirokunn wants to merge 2 commits into
split/emitter-retryfrom
split/emitter-timeout-after-retry

Conversation

@kahirokunn

@kahirokunn kahirokunn commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Fixes: cloudevents#564

Proposed Changes

Add configurable emitter timeouts with withTimeout().

Description

withTimeout() combines a per-call deadline with the caller's abort signal. Inside withRetry(), each attempt gets a fresh timeout; outside it, one timeout covers all attempts and backoff. The default retry policy does not retry timed-out HTTP sends.

Give each emitter invocation a configurable deadline and combine it with
the caller's abort signal. Preserve transport result and option types,
including per-send HTTP response handlers, and dispose timers and signal
subscriptions when the invocation settles.

The wrapped emitter must honor its signal. This feature is independent of
retry behavior and does not change the built-in transport's default send.

Signed-off-by: kahirokunn <okinakahiro@gmail.com>
Keep timeout and retry independently reviewable, then check their combined
behavior when both wrappers are available. Restore the existing
per-attempt timeout coverage and document both wrapper orders.

Verify that a whole-delivery deadline interrupts retry backoff before a
second attempt, preserving the timeout reason rather than resending.

Signed-off-by: kahirokunn <okinakahiro@gmail.com>
@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Add support for request timeout in HTTP transport

1 participant