package fuseau
-
fuseau.unix
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Basic channels
val is_empty : _ t -> bool
val size : _ t -> int
Current number of items in the channel
val create : ?max_size:int -> unit -> 'a t
New channel.
val close : _ t -> unit
Close the channel. Calls to receive_exn
will still succeed as long as items remain in the channel, until the channel is entirely drained; then they fail with Closed
.
val receive : 'a t -> 'a option
receive c
receives an item from c
. Suspends if the channel is empty but not closed. Returns None
if the channel is empty and closed.
val receive_exn : 'a t -> 'a
receive_exn c
receives an item from the channel. Suspends if the channel is empty and non-closed.
val send : 'a t -> 'a -> unit
send c x
sends x
over the channel c
. This might suspend the current fiber if the channel is full.
ev_send c x
is an event that sends x
into c
when there is room for it