Skip to content

Add timeout support to Condition#wait - #473

Open
samuel-williams-shopify wants to merge 1 commit into
mainfrom
condition-wait-timeout
Open

Add timeout support to Condition#wait#473
samuel-williams-shopify wants to merge 1 commit into
mainfrom
condition-wait-timeout

Conversation

@samuel-williams-shopify

Copy link
Copy Markdown
Contributor

Summary

  • add a timeout: keyword to Async::Condition#wait, inherited by Async::Notification
  • raise Async::TimeoutError when the timeout expires
  • preserve successful signal(nil) by wrapping delivered values internally
  • add shared coverage for both condition implementations and an Unreleased note

This allows callers to write notification.wait(timeout: 1) directly instead of wrapping the wait with Task#with_timeout.

Validation

  • bundle exec sus — 546 tests, 1,202 assertions
  • RuboCop passes for all changed Ruby files
  • git diff --check

The repository-wide RuboCop run still reports five pre-existing offenses under external/. The Decode documentation coverage task also currently crashes inside Decode while parsing the repository.

Assisted-By: devx/618580b0-d55f-4c2e-95b6-87e648f60543
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant