ITaskQueue

Description

interface Tinman.Core.Threading.Pooling.ITaskQueue
<TInput>
<TOutput>

A queue of task invocations.

See also

ITask.Queue

Public / Methods

Flush


public method Flush → ()

Blocks the calling thread until all queued tasks have finished.

PoolingException

If a call to TaskResultVoid.Finish resp. TaskResult.Finish on a pending task has thrown a PoolingException

Pop


public method Pop → ()

returns → TOutput

The output data object.

Pops the next output from the task queue, waiting for a pending task to finish, if necessary.

This method should only be called when IsEmpty returns false.

PoolingException

If the task has thrown an exception.

Push


public method Push → (1)

input in : TInput

The input data object.

Pushes the given input data to the task queue.

This method should only be called when IsFull returns false.

Push​All


public method PushAll → (2)

input in : IEnumerable<TInput>

[not-null]
The input data objects.

output in : CollectorDelegate<TOutput>

[not-null]
The collector for output data objects. When the collector returns false, this method will stop pushing new input data objects to the task queue and will finish the pending task invocations, which will cause some more calls to the collector delegate.

returns → int32

The number of output data objects that have been passed to output in.

Pushes the given input data to the task queue.

While pushing input data objects to the task queue, this method adheres to the maximum number of pending task invocations that has been set for this task queue.

Public / Attributes

Is​Empty


public attribute IsEmpty → (get)

value : bool

true if the task queue is empty, false if not.

Checks if the task queue is currently empty, i.e. there is no output data object ready and there are no pending task invocations.

Calling Pop on an empty queue will never block and will always return the default output value.

Is​Full


public attribute IsFull → (get)

value : bool

true if the task queue is full, false if not.

Checks if the task queue is currently full, i.e. the maximum number of pending task invocations has been reached.

Calling Push on a full queue will exceed the maximum number of pending task invocations, but will otherwise not have any adverse effects.

Is​Ready


public attribute IsReady → (get)

value : bool

true if at least one output data object is ready and can be fetched via Pop without blocking, false if not.

Checks if there is an output data object ready to be popped from the queue without blocking.

Task


public attribute Task → (get)

value : ITask<TInput, TOutput>

[not-null]
The task object.

The wrapped task object.