ColdTaskModule

PackageAxial
Functions for creating and executing cold tasks.

Summary

NameSignatureSynopsis
createColdTask.create operationCreates a cold task from a cancellable factory.
fromTaskFactoryColdTask.fromTaskFactory factoryCreates a cold task from a factory that does not observe cancellation.
awaitStartedTaskColdTask.awaitStartedTask startedTaskWraps a task that has already been started.
fromValueTaskFactoryColdTask.fromValueTaskFactory factoryCreates a cold task from a cancellable value-task factory.
fromValueTaskFactoryWithoutCancellationColdTask.fromValueTaskFactoryWithoutCancellation factoryCreates a cold task from a value-task factory that does not observe cancellation.
awaitStartedValueTaskColdTask.awaitStartedValueTask startedValueTaskWraps a value task that has already been started.
runColdTask.run cancellationToken coldTaskExecutes the cold task with the supplied cancellation token.

create

ColdTask.create operation
Member
Creates a cold task from a cancellable factory.

Parameters

NameTypeDescription
operationCancellationToken -> Task<'value>The factory invoked on each execution.

Returns

ColdTask<'value>

fromTaskFactory

ColdTask.fromTaskFactory factory
Member
Creates a cold task from a factory that does not observe cancellation.

Parameters

NameTypeDescription
factoryunit -> Task<'value>The factory invoked on each execution.

Returns

ColdTask<'value>

awaitStartedTask

ColdTask.awaitStartedTask startedTask
Member
Wraps a task that has already been started.

Parameters

NameTypeDescription
startedTaskTask<'value>A task that is already running.

Returns

ColdTask<'value>

fromValueTaskFactory

ColdTask.fromValueTaskFactory factory
Member
Creates a cold task from a cancellable value-task factory.

Parameters

NameTypeDescription
factoryCancellationToken -> ValueTask<'value>The factory invoked on each execution.

Returns

ColdTask<'value>

fromValueTaskFactoryWithoutCancellation

ColdTask.fromValueTaskFactoryWithoutCancellation factory
Member
Creates a cold task from a value-task factory that does not observe cancellation.

Parameters

NameTypeDescription
factoryunit -> ValueTask<'value>The factory invoked on each execution.

Returns

ColdTask<'value>

awaitStartedValueTask

ColdTask.awaitStartedValueTask startedValueTask
Member
Wraps a value task that has already been started.

Parameters

NameTypeDescription
startedValueTaskValueTask<'value>A value task that is already running.

Returns

ColdTask<'value>

run

ColdTask.run cancellationToken coldTask
Member
Executes the cold task with the supplied cancellation token.

Parameters

NameTypeDescription
cancellationTokenCancellationTokenThe token passed to the cold task factory.
coldTaskColdTask<'value>The cold task to execute.

Returns

Task<'value>