Share via


CancellationToken.Register Method (F#)

Registers an action to perform with the CancellationToken.

Namespace/Module Path: System.Threading

Assembly: FSharp.Core (in FSharp.Core.dll)

// Signature:
member this.Register : Action<obj> * obj -> CancellationTokenRegistration

// Usage:
cancellationToken.Register (action, state)

Parameters

  • action
    Type: Action<T><obj>

    The action to associate with the token.

  • state
    Type: obj

    The state associated with the action.

Return Value

The created registration object.

Remarks

This API is provided for use only with the F# Runtime that targets .NET Framework 2.0. If you are using .NET Framework 4, use the .NET Framework 4 API with the same name, Register.

Platforms

Windows 7, Windows Vista SP2, Windows XP SP3, Windows XP x64 SP2, Windows Server 2008 R2, Windows Server 2008 SP2, Windows Server 2003 SP2

Version Information

F# Runtime

Supported in: 2.0

Silverlight

Supported in: 3

See Also

Reference

Threading.CancellationToken Structure (F#)

System.Threading Namespace (F#)