Logo Orsak

CancellationProvider Module

Creates ICancellationProviders, for an environment that doesn't begin cancellation scopes, such as one in a test. To link a source to a token, use CancellationScope.LinkedTo, which is a provider too; to cancel after a timeout, Cancellation.timeout.

Functions and values

Function or value Description

create ()

Full Usage: create ()

Parameters:
    () : unit

Returns: CancellationScope

A provider of a new source, linked to no token: a CancellationScope, which is its own source. Dispose it when done with it.

() : unit
Returns: CancellationScope
Example

 use cancellation = CancellationProvider.create ()
val cancellation: obj

fromSource source

Full Usage: fromSource source

Parameters:
Returns: ICancellationProvider

A provider of source, which every read of Source returns. The caller keeps owning the source, and disposes it.

source : CancellationTokenSource

The source to provide.

Returns: ICancellationProvider

Type something to start searching.