Hacker News new | ask | show | jobs
by breatheoften 195 days ago
Is there any way to implement structured concurrency on top of the std.Io primitive?
1 comments

    var group: Io.Group = .init;
    defer group.cancel(io);
If you see this pattern, you are doing structured concurrency.

Same thing with:

    var future = io.async(foo, .{});
    defer future.cancel(io);