Module Ccell.Bcast


module Bcast: sig .. end
Broadcast channel.

This module provides the broadcat channel that send the data from the sender to many receivers.


type 'a t 
broadcast channel

receive buffer

type 'a port = 'a Ccell.Mbox.t 
val make : unit -> 'a t
Make a broadcast channel.
val send : 'a t -> 'a -> unit
send ch x sends x to all threads receive on this channel.
val receive : 'a t -> 'a Ccell.Event.event
receive ch receive a value from broadcast channel ch. Note there are't any buffers in the broadcast channel by default, receive only catch a sened value after the operation.
val make_port : 'a t -> 'a port
make_port b attaches a receive buffer to channel b. The buffer is stored into weak pointer array for auto garbage collection. Max number of buffers is 256.
val make_strong_port : 'a t -> 'a port
val receive_port : 'a port -> 'a Ccell.Event.event
Buffered receive.
val receive_port_all : 'a port -> 'a list Ccell.Event.event
receive_port_all port returns all values in this buffer.