Skip to contents

Reports whether the peer process still holds its liveness lock, in about a microsecond, without touching the rings. mizu_recv() and mizu_send() report peer death automatically as mizu_peer_gone. This function asks directly. A peer that closed the channel but still runs counts as alive.

Usage

mizu_alive(ch)

Arguments

ch

a channel handle from mizu_channel() (or the ch binding inside a peer expression).

Value

TRUE while the peer process is alive, FALSE after it dies. By then the survivor has deleted the channel's shared memory.

Examples

ch <- mizu_channel(quote(mizu_recv(ch)))
mizu_alive(ch)
#> [1] TRUE
mizu_close(ch)