PreviousUpNext

15.3.398  src/lib/src/lib/thread-kit/src/lib/mailcaster.api

## mailcaster.api

# Compiled by:
#     src/lib/std/standard.lib



# Asynchronous multicast (one-to-many) mailqueues.



###               "Every man has a right to be wrong in his opinions.
###                But no man has a right to be wrong in his facts."
###
###                                       -- Bernard Baruch



api Mailcaster {

    Mailcaster(X);
    Readqueue(X);

    make_mailcaster:  Void -> Mailcaster(X);
        #
        # Create a new multicaster.

    make_readqueue:  Mailcaster(X) -> Readqueue(X);
        #
        # Create a new readqueue for given mailcaster.

    clone_readqueue:  Readqueue(X) -> Readqueue(X);
        #
        # Create a new readqueue on a mailcaster.
        # The new readqueue will have the same state
        # as the given readqueue -- that is, the stream
        # of values seen on the two readqueues will be
        # identical.
        #
        # NOTE: If two (or more) independent threads
        # are reading from the same readqueue then the
        # clone operation may not be accurate.

    receive:   Readqueue(X) -> X;
    receive':  Readqueue(X) -> mailop::Mailop(X);
        #
        # Receive a message from a queue 

    transmit:  (Mailcaster(X), X) -> Void;
        #
        # Enter a value into all readqueues of the mailcaster.

};                      # api Mailcaster.


## COPYRIGHT (c) 1990 by John H. Reppy.  See SMLNJ-COPYRIGHT file for details.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext