-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 Allow a sender to cause its own timeout with
timeout_after
Problem: - `timeout_after(s, to)` cannot cause its own timeout. - The ability to write a sender that causes its own timeout is useful for tests. Solution: - Start the timer sender before the sender to be timed out. - This means the time allowed includes the time for the sender logic itself, rather than excluding it. That's an arbitrary decision that's easy to account for in production code, and starting the timer first means that tests can easily rig the sender to cause its own timeout, for easy timeout test scenarios. Notes: - Compare: `incite_on`. `timeout_after` is similar in this respect.
- Loading branch information
Showing
3 changed files
with
30 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters