TQueueType

A transactional FIFO queue, built from a transactional reference.

Specification

Kind
Type
Members
8
Examples
0
makeSignature
TQueue.make capacity
unboundedSignature
TQueue.unbounded
boundedSignature
TQueue.bounded capacity
offerSignature
TQueue.offer item queue
takeSignature
TQueue.take queue

Summary

NameSignatureSynopsis
Operations
makeTQueue.make capacityCreates a transactional queue with the supplied capacity, or unbounded when None.
unboundedTQueue.unbounded Creates an unbounded transactional queue.
boundedTQueue.bounded capacityCreates a bounded transactional queue.
offerTQueue.offer item queueAdds an item, retrying when the queue is at capacity.
takeTQueue.take queueRemoves and returns the oldest item, retrying when the queue is empty.
sizeTQueue.size queueReturns the number of items currently in the queue.
isEmptyTQueue.isEmpty queueReturns whether the queue is empty.
isFullTQueue.isFull queueReturns whether the queue is at its capacity.

Operations

kind:member

make

TQueue.make capacity
Member
Creates a transactional queue with the supplied capacity, or unbounded when None.

Parameters

NameTypeDescription
capacityint option

Returns

STM<TQueue<'a>>
kind:member

unbounded

TQueue.unbounded
Member
Creates an unbounded transactional queue.

Returns

STM<TQueue<'a>>
kind:member

bounded

TQueue.bounded capacity
Member
Creates a bounded transactional queue.

Parameters

NameTypeDescription
capacityint

Returns

STM<TQueue<'a>>
kind:member

offer

TQueue.offer item queue
Member
Adds an item, retrying when the queue is at capacity.

Parameters

NameTypeDescription
item'a
queueTQueue<'a>

Returns

STM<unit>
kind:member

take

TQueue.take queue
Member
Removes and returns the oldest item, retrying when the queue is empty.

Parameters

NameTypeDescription
queueTQueue<'a>

Returns

STM<'a>
kind:member

size

TQueue.size queue
Member
Returns the number of items currently in the queue.

Parameters

NameTypeDescription
queueTQueue<'a>

Returns

STM<int>
kind:member

isEmpty

TQueue.isEmpty queue
Member
Returns whether the queue is empty.

Parameters

NameTypeDescription
queueTQueue<'a>

Returns

STM<bool>
kind:member

isFull

TQueue.isFull queue
Member
Returns whether the queue is at its capacity.

Parameters

NameTypeDescription
queueTQueue<'a>

Returns

STM<bool>