Author hniksic
Recipients asvetlov, giampaolo.rodola, hniksic, pyneda, yselivanov
Date 2018-05-16.20:49:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
At the moment this can be done but it will cancel all the coroutines with any exception that is raised and at some occasions this may not be desired.

Does wait() really "cancel all the coroutines"? The documentation doesn't mention wait() canceling anything it only returns them in the `pending` set. It is gather() and wait_for() that cancel automatically.

If you want to cancel everything on some exception and not on another, you can easily implement the logic yourself, e.g:

tasks = [asyncio.ensure_future(example(x)) for x in range(20)]
done, pending = await asyncio.wait(tasks, return_when=FIRST_EXCEPTION)
for fut in done:
    except CancelException:
        for fut in pending:
Date User Action Args
2018-05-16 20:49:09hniksicsetrecipients: + hniksic, giampaolo.rodola, asvetlov, yselivanov, pyneda
2018-05-16 20:49:09hniksicsetmessageid: <>
2018-05-16 20:49:09hniksiclinkissue33403 messages
2018-05-16 20:49:09hniksiccreate