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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eventually should allow configuration for space between requests #793

Closed
LeoColman opened this issue May 29, 2019 · 10 comments
Closed

Eventually should allow configuration for space between requests #793

LeoColman opened this issue May 29, 2019 · 10 comments
Assignees
Labels
enhancement ✨ Suggestions for adding new features or improving existing ones.
Milestone

Comments

@LeoColman
Copy link
Member

No description provided.

@LeoColman LeoColman added the enhancement ✨ Suggestions for adding new features or improving existing ones. label May 29, 2019
@LeoColman LeoColman self-assigned this May 29, 2019
@matheusmessora
Copy link
Contributor

matheusmessora commented Jun 7, 2019

Based on Awailitiy, this is called Pooling.
Also, should be great if we create a default configuration from Duration and Pooling.
At the moment, eventually calls a while(true) method.

@sksamuel
Copy link
Member

sksamuel commented Jun 9, 2019

Yeah we must improve eventually. I looked at awatility and it seems to be basically the same as our eventually.

I think what we need to support are different durations, different polling methods, and what awaitility calls conditional evaluation listeners. https://github.com/awaitility/awaitility/wiki/Usage#condition-evaluation-listener

Happy for anyone to pick up this or I can tackle it.

@sksamuel sksamuel added this to the 3.4 milestone Jun 9, 2019
@sksamuel sksamuel mentioned this issue Jun 9, 2019
39 tasks
@matheusmessora
Copy link
Contributor

I'll try to work on that

@LeoColman
Copy link
Member Author

We're here to help if needed.

@matheusmessora
Copy link
Contributor

matheusmessora commented Jun 14, 2019

The actual eventually receives all the data inside the method parameters. For a non-breaking change, we can add more parameters with default values.

My suggestion is to create a "new" eventually. Maybe eventual returning a factory with customizable methods. Similar to awaitility.
This will improve the extensibility of the eventual function.
The polling interval by the default is already configured.

The result could be something like this:
eventual() { 1 == 1 }

eventual().during(ofSeconds(2)) { 1 == 1}

eventual().during(2).ignoreExceptions() { 1 == 1}

eventual().ignoreExceptions(IOException.class) { 1 == 1}

What do you guys think?

@LeoColman
Copy link
Member Author

Perhaps we can use the eventually construct, but deprecating the current eventually in favor of the builder alternative, and remove it in the future.

But I believe that using a builder is too much Javalistic, and we should come up with a better DSL for it (I don't have any suggestions yet :P)

@matheusmessora
Copy link
Contributor

matheusmessora commented Jun 14, 2019

Do you have a example of a good one?
PS: I came from Java. Don't judge me

@sksamuel
Copy link
Member

sksamuel commented Jun 15, 2019 via email

@LeoColman
Copy link
Member Author

I liked your example, @sksamuel

@sksamuel
Copy link
Member

I would like to see this in 3.4 so I can pick this up if it's stalled.

sksamuel added a commit that referenced this issue Jul 15, 2019
sksamuel added a commit that referenced this issue Jul 16, 2019
#888)

* Introduced await as a more feature rich version of eventually for when you want to use custom polling periods #793

* Added tests for fib

* PR changes

* Added contracts for arrow Try #802

* Back to interval
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ Suggestions for adding new features or improving existing ones.
Projects
None yet
Development

No branches or pull requests

3 participants