I added a new promise handling function called allSettled historically in most programming languages this function name waits for every promise to finish running (or failing) before performing operations on them.
I used this to wait for a batch of activities to run then handle the errors at the end if any exist.
I would like if I could implement here in the repository because leveraging the internals of the promise in the SDK here is a bit nasty to do in our repository.
This is a lot cleaner and could be useful to others.
I implemented the feature like this because of these two examples (as maxim suggested)
I added a new promise handling function called
allSettled
historically in most programming languages this function name waits for every promise to finish running (or failing) before performing operations on them.I used this to wait for a batch of activities to run then handle the errors at the end if any exist.
I would like if I could implement here in the repository because leveraging the internals of the promise in the SDK here is a bit nasty to do in our repository.
This is a lot cleaner and could be useful to others.
I implemented the feature like this because of these two examples (as maxim suggested)
https://github.com/temporalio/samples-java/tree/main/core/src/main/java/io/temporal/samples/batch
https://community.temporal.io/t/async-activities-in-workflow/896
SIDE NOTE:
Also fixes a bug in the scheduling code that was not pulling the
:schedule
key out of the options passed into the schedule like one would assume.