-
Notifications
You must be signed in to change notification settings - Fork 339
Implemented StreamExt::throttle #356
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
Conversation
@Wassasin as per @binarybana's suggestion in #342 we should probably not drop any messages in |
Certainly. I'll work on it during the impl days. ;) |
// with a pause of 2 seconds between each print | ||
}) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we could convert this to an actual test that would be ideal. I don't think it might be a bit too specific to have as a standalone example like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't think we quite need this example here, but I'll file a follow-up PR to do so. Thanks heaps!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very good! Added some comments to finish out the polish. Thanks so much for putting the time in to get this working!
Co-Authored-By: Yoshua Wuyts <yoshuawuyts+github@gmail.com>
Co-Authored-By: Yoshua Wuyts <yoshuawuyts+github@gmail.com>
…nto 342-stream-throttle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems great. Only CI is failing now, I think we should be good to merge once that's resolved. Thanks!
Even with 50ms/150ms (450ms max) the CI-test fails. Apparantly the CI-server is really really slow. Any ideas on how to fix it? I am reluctant to increase the max exec time to > 1 second for the test. |
@Wassasin perhaps all we should do is test the lower bounds. Ensure that at least n millis have passed, which is the only hard guarantee we provide about the throttle duration anyway. |
Testing on the CI is very insightful. Everything should be OK now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great; thanks a lot!
Closes #342. Still need to write documentation and tests.