select: Make promise cancellable.

This commit is contained in:
David Braun 2017-10-15 13:32:40 -04:00
parent 03ebfaf7ab
commit 67012b6f4b
No known key found for this signature in database
GPG key ID: 5694EEC4D129BDCF
3 changed files with 36 additions and 23 deletions

View file

@ -85,6 +85,9 @@ Returns a version of the channel that provides only write methods.
returns the channel of the first one that succeeds. Only the winning method is
executed to completion—the other methods have no effect.
All of the methods can be cancelled before completion by calling `cancel` on the
promise returned from `select`.
#### Examples
Imagine you're at a party and your next conversation depends on whom you run