Looking for solution to stop the task chain and not trigger onFailure or recover
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 268
- PR merge metrics
- No merged PRs in 30d
Description
Is there a way to pause the task sequence, check condition and cancel out the sequence.
```
Task t1 = Task.value(orderData);
Task t2 = t1.andThen( d -> d.setCurrency(Optional.of("dollars")));
Task t3 = t2.andThen( d -> {
if(d.getCurrency().equals("dollars")){
System.out.println("The verification is not passed throw error");
//// This is the part doesnt work as what I think it is. Is there a way to stop the process fro the rest of the task and not trigger the onFailure in temp ??
t2.cancel(new OrderDatagramValidationException.Item.ExistsException(1,"abc",1));
}
});
Task temp = t3.andThen( t -> {
throw new Exception();
}).onFailure( t->{
throw new Exception();
});
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Task.andThen, cancel, and onFailure calls shown in the issue and trace how cancellation and failure propagation are handled. Determine the supported behavior for stopping the sequence without invoking onFailure, and define completion as an implemented or documented way to achieve that behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100