Header menu logo IcedTasks

ColdTaskBuilderBase Type

Contains the coldTask computation expression builder.

Constructors

Constructor Description

ColdTaskBuilderBase()

Full Usage: ColdTaskBuilderBase()

Returns: ColdTaskBuilderBase
Returns: ColdTaskBuilderBase

Instance members

Instance member Description

this.Combine

Full Usage: this.Combine

Parameters:
    task1 : ColdTaskCode<'TOverall, unit> - The first part of the sequenced computation.
    task2 : ColdTaskCode<'TOverall, 'T> - The second part of the sequenced computation.

Returns: ColdTaskCode<'TOverall, 'T> An ColdTask that runs both of the computations sequentially.
Modifiers: inline
Type parameters: 'TOverall, 'T

Creates an ColdTask that first runs task1 and then runs computation2, returning the result of computation2.

The existence of this method permits the use of expression sequencing in the coldTask { ... } computation expression syntax.

task1 : ColdTaskCode<'TOverall, unit>

The first part of the sequenced computation.

task2 : ColdTaskCode<'TOverall, 'T>

The second part of the sequenced computation.

Returns: ColdTaskCode<'TOverall, 'T>

An ColdTask that runs both of the computations sequentially.

this.Delay

Full Usage: this.Delay

Parameters:
    generator : unit -> ColdTaskCode<'TOverall, 'T> - The function to run

Returns: ColdTaskCode<'TOverall, 'T> A coldTask that runs generator
Modifiers: inline
Type parameters: 'TOverall, 'T

Creates a ColdTask that runs generator

generator : unit -> ColdTaskCode<'TOverall, 'T>

The function to run

Returns: ColdTaskCode<'TOverall, 'T>

A coldTask that runs generator

this.For

Full Usage: this.For

Parameters:
    sequence : 'T seq - The sequence to enumerate.
    body : 'T -> ColdTaskCode<'TOverall, unit> - A function to take an item from the sequence and create an ColdTask. Can be seen as the body of the for expression.

Returns: ColdTaskCode<'TOverall, unit> An ColdTask that will enumerate the sequence and run body for each element.
Modifiers: inline
Type parameters: 'T, 'TOverall

Creates an ColdTask that enumerates the sequence seq on demand and runs body for each element.

The existence of this method permits the use of for in the coldTask { ... } computation expression syntax.

sequence : 'T seq

The sequence to enumerate.

body : 'T -> ColdTaskCode<'TOverall, unit>

A function to take an item from the sequence and create an ColdTask. Can be seen as the body of the for expression.

Returns: ColdTaskCode<'TOverall, unit>

An ColdTask that will enumerate the sequence and run body for each element.

this.Return

Full Usage: this.Return

Parameters:
    value : 'T - The value to return from the computation.

Returns: ColdTaskCode<'T, 'T> An ColdTask that returns value when executed.
Modifiers: inline
Type parameters: 'T

Creates an computation that returns the result v.

The existence of this method permits the use of return in the coldTask { ... } computation expression syntax.

value : 'T

The value to return from the computation.

Returns: ColdTaskCode<'T, 'T>

An ColdTask that returns value when executed.

this.TryFinally

Full Usage: this.TryFinally

Parameters:
    body : ColdTaskCode<'TOverall, 'T>
    compensation : unit -> unit - The action to be run after computation completes or raises an exception (including cancellation).

Returns: ColdTaskCode<'TOverall, 'T> An ColdTask that executes computation and compensation afterwards or when an exception is raised.
Modifiers: inline
Type parameters: 'TOverall, 'T

Creates an ColdTask that runs computation. The action compensation is executed after computation completes, whether computation exits normally or by an exception. If compensation raises an exception itself the original exception is discarded and the new exception becomes the overall result of the computation.

The existence of this method permits the use of try/finally in the coldTask { ... } computation expression syntax.

body : ColdTaskCode<'TOverall, 'T>
compensation : unit -> unit

The action to be run after computation completes or raises an exception (including cancellation).

Returns: ColdTaskCode<'TOverall, 'T>

An ColdTask that executes computation and compensation afterwards or when an exception is raised.

this.TryWith

Full Usage: this.TryWith

Parameters:
Returns: ColdTaskCode<'TOverall, 'T> An ColdTask that executes computation and calls catchHandler if an exception is thrown.
Modifiers: inline
Type parameters: 'TOverall, 'T

Creates an ColdTask that runs computation and returns its result. If an exception happens then catchHandler(exn) is called and the resulting computation executed instead.

The existence of this method permits the use of try/with in the coldTask { ... } computation expression syntax.

body : ColdTaskCode<'TOverall, 'T>
catch : exn -> ColdTaskCode<'TOverall, 'T>
Returns: ColdTaskCode<'TOverall, 'T>

An ColdTask that executes computation and calls catchHandler if an exception is thrown.

this.Using

Full Usage: this.Using

Parameters:
    resource : 'Resource - The resource to be used and disposed.
    binder : 'Resource -> ColdTaskCode<'TOverall, 'T> - The function that takes the resource and returns an asynchronous computation.

Returns: ColdTaskCode<'TOverall, 'T> An ColdTask that binds and eventually disposes resource.
Modifiers: inline
Type parameters: 'Resource, 'TOverall, 'T

Creates an ColdTask that runs binder(resource). The action resource.DisposeAsync() is executed as this computation yields its result or if the ColdTask exits by an exception or by cancellation.

The existence of this method permits the use of use and use! in the coldTask { ... } computation expression syntax.

resource : 'Resource

The resource to be used and disposed.

binder : 'Resource -> ColdTaskCode<'TOverall, 'T>

The function that takes the resource and returns an asynchronous computation.

Returns: ColdTaskCode<'TOverall, 'T>

An ColdTask that binds and eventually disposes resource.

this.While

Full Usage: this.While

Parameters:
    guard : unit -> bool - The function to determine when to stop executing computation.
    body : ColdTaskCode<'TOverall, unit>

Returns: ColdTaskCode<'TOverall, unit> An ColdTask that behaves similarly to a while loop when run.
Modifiers: inline
Type parameters: 'TOverall

Creates an ColdTask that runs computation repeatedly until guard() becomes false.

The existence of this method permits the use of while in the coldTask { ... } computation expression syntax.

guard : unit -> bool

The function to determine when to stop executing computation.

body : ColdTaskCode<'TOverall, unit>
Returns: ColdTaskCode<'TOverall, unit>

An ColdTask that behaves similarly to a while loop when run.

this.Zero

Full Usage: this.Zero

Returns: ColdTaskCode<'TOverall, unit> An ColdTask that returns ().
Modifiers: inline
Type parameters: 'TOverall

Creates an ColdTask that just returns ().

The existence of this method permits the use of empty else branches in the coldTask { ... } computation expression syntax.

Returns: ColdTaskCode<'TOverall, unit>

An ColdTask that returns ().

Type something to start searching.