FSharpx.Async


CircularQueueAgent<'T>

Namespace: FSharpx.Control

Agent that implements an asynchronous circular buffer with blocking enqueue and blocking dequeue operation (this implements the producer-consumer concurrent programming pattern). The constructor takes the maximal size of the buffer.

Constructors

ConstructorDescription
new(maxLength)
Signature: maxLength:int -> CircularQueueAgent<'T>

CompiledName: .ctor

Instance members

Instance memberDescription
AsyncDequeue(count, timeout)
Signature: (count:int * timeout:int option) -> Async<'T []>

Asynchronously gets item from the queue. If there are no items in the queue, the operation will block until items are added.

AsyncEnqueue(value, timeout)
Signature: (value:'T [] * timeout:int option) -> Async<unit>

Adds item to the queue. The operation ends when there is a place for the item. If the queue is full, the operation will block until some items are removed.

AsyncEnqueue(segment, timeout)
Signature: (segment:ArraySegment<'T> * timeout:int option) -> Async<unit>

Adds item to the queue. The operation ends when there is a place for the item. If the queue is full, the operation will block until some items are removed.

AsyncEnqueue(...)
Signature: (value:'T [] * offset:int * count:int * timeout:int option) -> Async<unit>

Adds item to the queue. The operation ends when there is a place for the item. If the queue is full, the operation will block until some items are removed.

Count
Signature: int

Gets the number of elements currently waiting in the queue.

CompiledName: get_Count

Dequeue(count, timeout)
Signature: (count:int * timeout:int option) -> 'T []

Synchronously gets item from the queue. If there are no items in the queue, the operation will block until items are added. This method blocks until value is available!

Enqueue(value)
Signature: (value:'T []) -> unit

Adds item to the queue. The operation ends when there is a place for the item. If the queue is full, the operation will block until some items are removed.

Enqueue(segment)
Signature: segment:ArraySegment<'T> -> unit

Adds item to the queue. The operation ends when there is a place for the item. If the queue is full, the operation will block until some items are removed.

Enqueue(value, offset, count)
Signature: (value:'T [] * offset:int * count:int) -> unit

Adds item to the queue. The operation ends when there is a place for the item. If the queue is full, the operation will block until some items are removed.

Fork me on GitHub