One-line summaries. A channel prints its region name, side, and conversation
state: open, closed once either side signalled close, or peer gone as
reported by mizu_alive(), probed at print. A pool prints its region name,
the role of this handle, live workers out of registry capacity, and pending
(uncompleted) tasks. A task handle prints its state, probed without consuming
the result. The state is pending, running, ok, err, cancel,
died, or lost in the result-slot vocabulary of mizu_pool_info(),
collected once the result is taken, or dropped when its pool is gone. A
mizu_call() task specification prints its qualified name, or the first
line of its source string truncated, and its argument counts. Sentinels
print as their class.
The handle methods never error and never touch the rings, and a handle whose
resources are released (a closed channel, a stopped pool) prints as closed,
so auto-printing is always safe.
Usage
# S3 method for class 'mizu_channel'
print(x, ...)
# S3 method for class 'mizu_pool'
print(x, ...)
# S3 method for class 'mizu_task'
print(x, ...)
# S3 method for class 'mizu_call'
print(x, ...)
# S3 method for class 'mizu_map'
print(x, ...)
# S3 method for class 'mizu_map_prepared'
print(x, ...)
# S3 method for class 'mizu_sentinel'
print(x, ...)
# S3 method for class 'mizu_error_remote'
print(x, ...)Examples
p <- mizu_pool()
p
#> <mizu_pool /mizu_9883_75e7dee7: controller, 1/1 workers live, 0 pending>
t <- mizu_submit(p, 1 + 1)
t
#> <mizu_task: ok>
mizu_collect(t)
#> [1] 2
mizu_pool_stop(p)
p
#> <mizu_pool: closed>
mizu_call("stats::quantile", runif(10))
#> <mizu_call: stats::quantile, 1 positional>