← All compilation units

Flyology.Channels.Bounded.Channel

Description

Idempotently reject new sends and let accepted values drain.

Await_Drained

entry Await_Drained

Wait until Close has occurred and the buffer is empty.

Close

procedure Close

Idempotently reject new sends and let accepted values drain.

Current

function Current return Snapshot

Read channel state under its protected lock.

Return value

Current close, buffer, and waiter counts

Receive

entry Receive (Value : out Element_Type)

Remove the oldest value, waiting while the open channel is empty.

Parameters
Value

Receives the oldest buffered value

Raised exceptions
Channel_Closed

The closed channel has been fully drained

Send

entry Send (Value : Element_Type)

Append Value, waiting while the open channel is full.

Parameters
Value

Value copied into the channel

Raised exceptions
Channel_Closed

Close occurs before the value is accepted

Try_Receive

procedure Try_Receive
  (Value  : in out Element_Type;
   Result : out Try_Receive_Result)

Attempt to remove the oldest value without waiting. Value is assigned only when Result is Item_Received.

Parameters
Value

Receives the oldest buffered value on success

Result

Item_Received, Channel_Empty, or Receive_Closed

Try_Send

procedure Try_Send
  (Value  : Element_Type;
   Result : out Try_Send_Result)

Attempt to append without waiting.

Parameters
Value

Value to copy if capacity is available

Result

Item_Sent, Channel_Full, or Send_Closed