fail fast capability
See original GitHub issueHi,
I’m a big fan of this marvel of engineering. Recently integrating with a 3d party we detected that some requests run to long. The first go to was to see the documentation for FailSafe. Unfortunately no luck. Below is an example of use case we want to have.
@Test
public void the_duration_of_the_test_is_10ms() throws Exception {
CircuitBreaker breaker = new CircuitBreaker()
.withTimeout(10, TimeUnit.MILLISECONDS);
Failsafe.with(breaker)
.get(() -> {
Thread.sleep(20000); // emulate the long running task
return 0;
});
}
I expected withTimeout
to help me here to cut the execution with a failure at 10ms.
Is this something you guys have on the radar ? Or any work around will be appreciated
Thank you
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
How To Fail Faster -- And Why You Should - Forbes
Facilitate moderate (not too hard or too easy) challenges employees need to work through. Tolerate—indeed, embrace—failure as a necessary input ...
Read more >Understanding the need to "Fail Fast". - LinkedIn
Failing fast does mean simply “going faster” or “working harder” as much as “understanding risks and being iterative”. Generally speaking, ...
Read more >Fail-fast - Wikipedia
In systems design, a fail-fast system is one which immediately reports at its interface any condition that is likely to indicate a failure....
Read more >Fail Fast - Martin Fowler
Failing fast is a nonintuitive technique: “failing immediately and visibly” sounds like it would make your software more fragile, but it actually makes...
Read more >Fail-fast Is Failing... Fast! - ACM Queue
For more than 40 years, fail-fast has been the dominant way of achieving fault tolerance. In this approach, some mechanism is responsible ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jhalterman thank you for quick reply. Here is what came up for now. Sharing it here maybe other people can find it useful or take it from here and push it forward.
A new
Timeout
policy has been merged which supports failing an execution, and optionally interrupting or cancelling it:https://github.com/jhalterman/failsafe#timeouts
This was just released in 2.2.0.