bounded


Description:

public static Channel<G> bounded<G> (int proposed_capacity)

Creates a bounded channel.

If proposed_capacity == 0, returns an unbuffered channel of which capacity is zero. It is a symmetric rendezvous queue and has no buffer to hold data, but its send and receive operations are done symmetrically, i.e., wait for one another.

If proposed_capacity > 0, returns a buffered channel of which capacity is at least proposed_capacity, i.e, the actual capacity could be greater than proposed_capacity. It can hold data up to the capacity.

Parameters:

proposed_capacity

a proposed capacity.

Returns:

a bounded channel