queue(3)

MODULE
queue - Abstract Data Type for FIFO Queues

DESCRIPTION

This module implements FIFO queues in an efficient manner.

EXPORTS

new() -> Queue

    Types
        Queue = queue()

    Returns an identifier for the queue.

in(Item, Q1) -> Q2

    Types
        Item = term()
        Q1 = Q2 = queue()

    Inserts Item into the queue Q1. Returns a new queue Q2.

out(Q) -> Result

    Types
        Result = {{value, Item}, Q1} | {empty, Q2}
        Q = Q1 = Q2 = queue()

    Removes the oldest element from the queue Q. Returns the tuple {{value, Item}, Q2}, where Item is the element removed and Q1 is an identifier for the new queue. If Q is empty, the tuple {empty, Q2} is returned.

AUTHOR
Claes Wikstrom - klacke@erix.ericsson.se