-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
New operator - delayBetween #3582
Comments
Just to be clear on the behaviour, please try this:
Output:
Is this behaviour what you are looking for? |
@chemicL Take a look at the following sample code:
|
Please provide something I can copy and paste, without any internal details of your project. |
Hmm, seems to be working after second try. Was hoping if we can have an built-in operator though. Is it part of the roadmap? |
Let's leave the issue open for some time. If there is interest in a new operator and this issue gets some traction, we can consider adding it. However, it seems this is behaviour can be easily achieved with existing operators. Another alternative would probably be
|
It would be handy, even if doable in an other way. Pipelines would be easier to read too. |
Well thinking more about this, a real delayBetween operator would not only be skipping the first element waiting. That is more a special case.
|
@alixroyere in this case it's probably a good use for a Consider this:
With the output:
I believe this is even more appropriate for the original case, where it seems the events should happen every hour, regardless how long each individual task takes. |
It is useful. I am looking for this too. And this is the usual use case. Delay all (including the first element) is rarely needed. |
Summary:
Current Flux.delayElements will delay the elements since the start of the first elements. It would be nice to have another operator that will give delay between elements.
Example:
Flux.delayElements(Duration.ofHour(1))
5 Elements arrived --> delay 1 hour --> element 1 processed --> delay 1 hour --> element 2 processed ...
Flux.delayBetween(Duration.ofHour(1))
5 elements arrived --> element 1 processed --> delay 1 hour --> element 2 processed ...
The text was updated successfully, but these errors were encountered: