Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeout operator #163

Closed
vitaly-t opened this issue Oct 15, 2022 · 3 comments
Closed

timeout operator #163

vitaly-t opened this issue Oct 15, 2022 · 3 comments
Labels
enhancement New feature or request feedback wanted Possible feature, depending on feedback

Comments

@vitaly-t
Copy link
Owner

vitaly-t commented Oct 15, 2022

New operator timeout that ends iteration after a specified number of milliseconds:

timeout(ms: number)

@RebeccaStevens What do you think? 馃槈

UPDATE

Previously, I thought this was achievable via operator stop, but then I realized it would not account for the time spent getting the first value, so it's no good.

This new operator simplifies it a lot, and it accounts for the first iteration value also.

@vitaly-t vitaly-t added enhancement New feature or request feedback wanted Possible feature, depending on feedback labels Oct 15, 2022
vitaly-t added a commit that referenced this issue Oct 15, 2022
@vitaly-t
Copy link
Owner Author

vitaly-t commented Oct 15, 2022

Added implementation in branch timeout ;)

It just needs some tests + docs, to finish fully.

vitaly-t added a commit that referenced this issue Oct 15, 2022
@vitaly-t
Copy link
Owner Author

vitaly-t commented Oct 15, 2022

I'm now thinking about, maybe, adding a second parameter - optional callback that's called only when the timeout was triggered, so the timeout event can be logged, for instance.

vitaly-t added a commit that referenced this issue Oct 15, 2022
@vitaly-t
Copy link
Owner Author

The operator has been fully finished, and released with v2.0.0-beta.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feedback wanted Possible feature, depending on feedback
Projects
None yet
Development

No branches or pull requests

1 participant