Table of Contents

Class TaskRegistry

Namespace
LfrlAnvil.Async
Assembly
LfrlAnvil.Core.dll

Represents an object useful for storing in-progress Task instances.

public sealed class TaskRegistry
Inheritance
TaskRegistry
Inherited Members
Extension Methods

Constructors

TaskRegistry()

Creates a new empty TaskRegistry instance.

public TaskRegistry()

Properties

Count

Returns the current amount of stored in-progress Task instances.

public int Count { get; }

Property Value

int

Tasks

Returns all currently stored in-progress Task instances.

public Task[] Tasks { get; }

Property Value

Task[]

Methods

Add(Task)

Registers provided task in this registry and stores it until it gets completed. Does nothing when task is already completed.

public void Add(Task task)

Parameters

task Task

Task to register.

Remarks

Task continuation that is responsible for removing provided task from this registry once it gets completed is created with the ExecuteSynchronously option.

Exceptions

ArgumentException

When TaskStatus of task is equal to Created or when task has already been registered.

Contains(Task)

Checks if the provided task is currently stored by this registry.

[Pure]
public bool Contains(Task task)

Parameters

task Task

Task to check for.

Returns

bool

true when task is currently stored by this registry, otherwise false.