[Async-sig] Blog post: Timeouts and cancellation for humans

Dima Tisnek dimaqq at gmail.com
Thu Jan 11 22:49:56 EST 2018


Very nice read, Nathaniel.

The post left me wondering how cancel tokens interact or should
logically interact with async composition, for example:

with move_on_after(10):
    await someio.gather(a(), b(), c())

or

with move_on_after(10):
    await someio.first/race(a(), b(), c())

or

dataset = someio.Future(large_download(), move_on_after=9999)

task a:
    with move_on_after(10):
        use((await dataset)["a"])

task b:
    with move_on_after(10):
        use((await dataset)["b"])


On 11 January 2018 at 18:09, Nathaniel Smith <njs at pobox.com> wrote:
> Hi all,
>
> Folks here might be interested in this new blog post:
>
> https://vorpus.org/blog/timeouts-and-cancellation-for-humans/
>
> It's a detailed discussion of pitfalls and design-tradeoffs in APIs
> for timeout and cancellation, and has a proposal for handling them in
> a more Pythonic way. Any feedback welcome!
>
> -n
>
> --
> Nathaniel J. Smith -- https://vorpus.org
> _______________________________________________
> Async-sig mailing list
> Async-sig at python.org
> https://mail.python.org/mailman/listinfo/async-sig
> Code of Conduct: https://www.python.org/psf/codeofconduct/


More information about the Async-sig mailing list