2 * 2004 Matthew Fluet (mfluet@acm.org)
3 * Ported to MLton threads.
8 * COPYRIGHT (c) 1990 by John H. Reppy. See COPYRIGHT file for details.
10 * Asynchronous multicast (one-to-many) channels.
17 type 'a event = 'a CML.event
19 (* create a new multicast channel *)
20 val mChannel : unit -> 'a mchan
21 (* create a new output port on a channel *)
22 val port : 'a mchan -> 'a port
23 (* create a new output port on a channel that has the same state as the
24 * given port. I.e., the stream of messages seen on the two ports will
26 * NOTE: if two (or more) independent threads are reading from the
27 * same port, then the copy operation may not be accurate.
29 val copy : 'a port -> 'a port
30 (* receive a message from a port *)
31 val recv : 'a port -> 'a
32 val recvEvt : 'a port -> 'a event
33 (* send a message to all of the ports of a channel *)
34 val multicast : ('a mchan * 'a) -> unit