Skip to content

feat(timeout): add dynamic duration hooks - #93

Merged
thomhurst merged 1 commit into
mainfrom
issue-86-dynamic-timeout-hooks
Aug 21, 2026
Merged

feat(timeout): add dynamic duration hooks#93
thomhurst merged 1 commit into
mainfrom
issue-86-dynamic-timeout-hooks

Conversation

@thomhurst

Copy link
Copy Markdown
Owner

Summary

  • add context-aware awaited TimeoutGenerator with per-execution validation
  • add ordered OnTimeoutAsync after cleanup and the synchronous notification
  • preserve caller-cancellation arbitration, exception identity, typed/sync execution, and pooled-context lifetime
  • document callback ordering, concurrency, cancellation, and synchronous blocking semantics
  • add fixed, sync-generated, truly async-generated, and async-hook-configured benchmarks

Part of #75.

Validation

  • dotnet build Kevlar.slnx -c Release (0 warnings/errors)
  • unit: 541 passed
  • integration: 16 passed
  • analyzers: 19 passed
  • netstandard: 1 passed
  • allocation: 2 passed
  • npm run build
  • Verify-Packages.ps1
  • Verify-DocSnippets.ps1 (82 snippets)

Benchmarks

BenchmarkDotNet ShortRun, .NET 10.0.11, x64:

  • fixed timeout: 109.0 ns / 0 B before; 112.2 ns / 0 B after (+2.9%, overlapping confidence intervals)
  • synchronous generator: 120.2 ns / 0 B
  • async hook configured, happy path: 116.8 ns / 0 B
  • truly asynchronous generator: 1.116 us / 687 B

Closes #86

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@thomhurst, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 8 minutes

Limit details: You’ve used all 10 included reviews currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 740be0fb-2a8e-4569-9f66-e1d75db9cacc

📥 Commits

Reviewing files that changed from the base of the PR and between a1addff and a10600f.

📒 Files selected for processing (6)
  • benchmarks/Kevlar.Benchmarks/TimeoutBenchmarks.cs
  • docs/docs/strategies/timeout.md
  • src/Kevlar/PublicAPI.Unshipped.txt
  • src/Kevlar/Strategies/Timeout/TimeoutOptions.cs
  • src/Kevlar/Strategies/Timeout/TimeoutStrategy.cs
  • tests/Kevlar.Tests/TimeoutDynamicOptionsTests.cs

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

@thomhurst
thomhurst merged commit b66fd65 into main Aug 21, 2026
7 checks passed
@thomhurst
thomhurst deleted the issue-86-dynamic-timeout-hooks branch August 21, 2026 16:05
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.

feat(timeout): add dynamic duration and async hooks

1 participant