Skip to content

AsyncTimeoutSequence #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025
Merged

AsyncTimeoutSequence #5

merged 1 commit into from
Jun 3, 2025

Conversation

swhitty
Copy link
Owner

@swhitty swhitty commented Jun 3, 2025

Adds AsyncTimeoutSequence that throws an error if any iteration takes longer than the specified timeout.

The timeout is reset for each iteration.

for try await val in sequence.timeout(seconds: 2.0) {
   ...
}

Duration can be used where available:

for try await val in sequence.timeout(duration: .milliseconds(100)) {
   ...
}

@swhitty swhitty force-pushed the AsyncTimeoutSequence branch from f44f193 to bc4e271 Compare June 3, 2025 07:44
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 97.82609% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.94%. Comparing base (1e1f9ce) to head (bc4e271).

Files with missing lines Patch % Lines
Sources/AsyncTimeoutSequence.swift 97.82% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #5      +/-   ##
==========================================
+ Coverage   97.46%   97.94%   +0.48%     
==========================================
  Files           5        6       +1     
  Lines         197      243      +46     
==========================================
+ Hits          192      238      +46     
  Misses          5        5              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@swhitty swhitty merged commit 3064fff into main Jun 3, 2025
16 checks passed
@swhitty swhitty deleted the AsyncTimeoutSequence branch June 3, 2025 07:50
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.

2 participants