#thread pool spawn, errorable function

1 messages · Page 1 of 1 (latest)

torpid wharf
#

When I attempt to use spawn on a Thread.Pool with the function being one that can propagate an error, I receive this:

$ZIG_PATH/lib/zig/std/Thread/Pool.zig:152:13: error: error union is ignored
            @call(.auto, func, closure.arguments);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ZIG_PATH/lib/zig/std/Thread/Pool.zig:152:13: note: consider using 'try', 'catch', or 'if'

Is there any way around this?

balmy crag
#

wrap it in a function that doesn't error

#

the thread pool has no way to return the error to someone that can handle it