Table of Contents

Class CancellationChangeToken

Namespace
Acuit.Pinpoint.Primitives
Assembly
Acuit.Pinpoint.Configuration.dll

A IChangeToken implementation using CancellationToken.

public class CancellationChangeToken : IChangeToken
Inheritance
CancellationChangeToken
Implements
Inherited Members

Constructors

CancellationChangeToken(CancellationToken)

Initializes a new instance of CancellationChangeToken.

public CancellationChangeToken(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The CancellationToken.

Properties

ActiveChangeCallbacks

Indicates if this token will pro-actively raise callbacks. If false, the token consumer must poll HasChanged to detect changes.

public bool ActiveChangeCallbacks { get; }

Property Value

bool

HasChanged

Gets a value that indicates if a change has occurred.

public bool HasChanged { get; }

Property Value

bool

Methods

RegisterChangeCallback(Action<object>, object)

Registers for a callback that will be invoked when the entry has changed. HasChanged MUST be set before the callback is invoked.

public IDisposable RegisterChangeCallback(Action<object> callback, object state)

Parameters

callback Action<object>

The Action<T> to invoke.

state object

State to be passed into the callback.

Returns

IDisposable

An IDisposable that is used to unregister the callback.