Table of Contents

Class PollingFileChangeToken

Namespace
Acuit.Pinpoint.FileProviders.Physical
Assembly
Acuit.Pinpoint.Configuration.dll

A change token that polls for file system changes.

This change token does not raise any change callbacks. Callers should watch for HasChanged to turn from false to true and dispose the token after this happens.

public class PollingFileChangeToken : IChangeToken
Inheritance
PollingFileChangeToken
Implements
Inherited Members

Remarks

Polling occurs every 4 seconds.

Constructors

PollingFileChangeToken(FileInfo)

Initializes a new instance of PollingFileChangeToken that polls the specified file for changes as determined by LastWriteTimeUtc.

public PollingFileChangeToken(FileInfo fileInfo)

Parameters

fileInfo FileInfo

The FileInfo to poll

Properties

ActiveChangeCallbacks

Always false.

public bool ActiveChangeCallbacks { get; }

Property Value

bool

HasChanged

True when the file has changed since the change token was created. Once the file changes, this value is always true

public bool HasChanged { get; }

Property Value

bool

Remarks

Once true, the value will always be true. Change tokens should not re-used once expired. The caller should discard this instance once it sees HasChanged is true.

Methods

RegisterChangeCallback(Action<object>, object)

Does not actually register callbacks.

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

Parameters

callback Action<object>

This parameter is ignored

state object

This parameter is ignored

Returns

IDisposable

A disposable object that noops when disposed