# std.Io.Group: async and concurrent support Cancelable results · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/2a02c7a0d59e25bac07a6ed2948a29438fb05527)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 2a02c7a0d59e25bac07a6ed2948a29438fb05527

Requested commit: 2a02c7a0d59e25bac07a6ed2948a29438fb05527

Commit: 2a02c7a0d59e25bac07a6ed2948a29438fb05527

Tree: e68a1855272d8d64d1934802501eb2d45f0992f3

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.Io.Group: async and concurrent support Cancelable results

Now, the return type of functions spawned with `Group.async` and
`Group.concurrent` may be anything that coerces to `Io.Cancelable!void`.

Before this commit, group tasks were the only exception to the rule
"error.Canceled should never be swallowed". Now, there is no exception,
and it is enforced with an assertion upon closure completion.

Finally, fixes a case of swallowing error.Canceled in the compiler,
solving a TODO.

There are three ways to handle `error.Canceled`. In order of most
common:
1. Propagate it
2. After receiving it, io.recancel() and then don't propagate it
3. Make it unreachable with io.swapCancelProtection()

```

## Parents

- [2adfd4d107f071f91608bef22c7e91b1a9a93470](https://git.cafe/gitcafe/zig/commit/2adfd4d107f071f91608bef22c7e91b1a9a93470?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/2a02c7a0d59e25bac07a6ed2948a29438fb05527?format=markdown)
