socketry / async

An awesome asynchronous event-driven reactor for Ruby.
MIT License
2.04k stars 85 forks source link

Stopping remaining tasks upon completion of one task #302

Open ukazap opened 5 months ago

ukazap commented 5 months ago

In scenarios where multiple tasks are running concurrently, and I need to stop all other tasks prematurely when one of them finishes; Is there a built-in mechanism or an established pattern within the async gem that would help address this use case?

trevorturk commented 5 months ago

I think this discussion may be of interest: https://github.com/socketry/async/discussions/292

ukazap commented 5 months ago

Async::Waiter seems to be what I’m looking for, unfortunately I’m stuck at Ruby 3.0.1. Would it be possible to backport?