FSharpx.Async


BlockingQueueAgent<'T>

Namespace: FSharpx.Control

Agent that implements an asynchronous queue with blocking put and blocking get 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 -> BlockingQueueAgent<'T>

CompiledName: .ctor

Instance members

Instance memberDescription
Add(v)
Signature: v:'T -> unit

Asynchronously 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. This overload does not signal the caller that the item has been added.

AsyncAdd(v, timeout)
Signature: (v:'T * timeout:int option) -> Async<unit>

Asynchronously 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.

AsyncGet(timeout)
Signature: (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.

Count
Signature: int

Gets the number of elements currently waiting in the queue.

CompiledName: get_Count

Get(timeout)
Signature: (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!

Fork me on GitHub