Closed adam-fowler closed 8 months ago
Sounds like a good idea, though it should be renamed probably since it also waits for graceful shutdown?
Also, worth lifting such type into concurrency library perhaps?
Also, worth lifting such type into concurrency library perhaps?
You'd have to lift the whole graceful shutdown system into the Concurrency library then (which isn't necessarily a bad thing).
I meant a form of this without the graceful shutdown, "wait for cancellation" minor trick but might be nice to lift eventually. I often feel we're missing small convenient things like that
@FranzBusch ?
This is actually already publicly exposed. Just use try await gracefulShutdown()
which will wait for either cancellation or graceful shutdown. In case of cancellation you will get a CancellationError
thrown.
I've implemented a version (I forgot to add cancellation support as well as graceful shutdown), I know other people have done the same as well. Should we be just using the one that is already written here