Moonpool.ChanChannels.
The channels have bounded size. Push/pop return futures or can use effects to provide an await-friendly version.
The channels became bounded since @0.7 .
val create : max_size:int -> unit -> 'a tCreate a channel.
val try_push : 'a t -> 'a -> booltry_push chan x pushes x into chan. This does not block. Returns true if it succeeded in pushing.
val try_pop : 'a t -> 'a optiontry_pop chan pops and return an element if one is available immediately. Otherwise it returns None.
val close : _ t -> unitClose the channel. Further push and pop calls will fail. This is idempotent.
val push : 'a t -> 'a -> unitPush the value into the channel, suspending the current task if the channel is currently full.
val pop : 'a t -> 'aPop an element. This might suspend the current task if the channel is currently empty.