Comments (4)
Your listener should only get called if doAnything
throws an exception. I just pushed a test to verify this behavior and things seem to be working as expected. Two things to note:
The current API in master is a bit different than from the last release. The listener now accepts a result and a failure since failure could indicate an exception being thrown or a bad result being returned. That said, the listener is called as expected in the test.
Let me know what you think.
from failsafe.
I assumed that a exceeded retry policy would trigger the failure event. I use your library on a udp protocol, since there is not always a result. My solution at the moment is that I check the result to be present. If there no result, it must be a timeout. A "retryExceeded"-Handler would be nice.
Thank you!
from failsafe.
@Haardt I know this is an old issue, but I wanted to dig it back up again to make sure I understand your use case. Basically, you'd like your failure handler to be called if retries are exceeded and some unexpected result occurred? The unexpected result bit is important because that's how Recurrent knows to keep trying. Maybe an example policy:
retryPolicy = new RetryPolicy()
.withDelay(100, TimeUnit.MILLISECONDS)
.withMaxDuration(2, TimeUnit.SECONDS)
.withMaxRetries(3)
.whenResult(null);
This would perform retries so long as the result is null
and the whenFailure
handler would be called if a non-null result is never returned. Does this work for you?
from failsafe.
Also - See the new event listeners API that allows you to listen specifically for onCompleted, onFailed, etc. events:
https://github.com/jhalterman/recurrent#event-listeners
from failsafe.
Related Issues (20)
- Make CircuitBreaker delay time mockable for testing HOT 6
- Support Java Modules HOT 1
- Add Failsafe to vertx-awesome HOT 1
- Result futures strongly retain supplying functions
- Why does CheckedPredicate exist? HOT 2
- Also add note about default maxRetries of 3 to maxDuration section of the documentation HOT 7
- Bulkhead policy may drop requests when maxWaitTime is specified HOT 8
- Guidance around CheckedPredicate HOT 2
- Time based error limiter policy
- [Question]Can withBackoff and withDelay be used at the same time? HOT 2
- RetryPolicy handleIf not working with DynamoDbException in predicate HOT 4
- Having a context object in the run(...) and get(...) methods HOT 7
- dev.failsafe.Functions.* do not propagate toString to the wrapped object
- [Question] Is it possible to have multiple Fallback policies in one Failsafe executor? HOT 4
- [question] how to use failsafe with kotlin
- Feature Request: Integrate / add support for Lunar Proxy (backend policy) HOT 1
- Why recommend CircuitBreaker before Retry? HOT 1
- CircuitBreaker stays in OPEN even after DELAY time HOT 1
- Nested retries, how to prevent duplicate retrying? HOT 5
- FailsafeExecutor.compose and .with(Executor) have surprising composition behavior
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from failsafe.