Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

PollingFileChangeToken Class

Definition

Namespace:
Microsoft.Extensions.FileProviders.Physical
Assembly:
Microsoft.Extensions.FileProviders.Physical.dll
Package:
Microsoft.Extensions.FileProviders.Physical v11.0.0-preview.5.26302.115
Source:
PollingFileChangeToken.cs
Source:
PollingFileChangeToken.cs
Source:
PollingFileChangeToken.cs
Source:
PollingFileChangeToken.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

A change token that polls for file system changes.

public ref class PollingFileChangeToken : Microsoft::Extensions::Primitives::IChangeToken
public class PollingFileChangeToken : Microsoft.Extensions.Primitives.IChangeToken
type PollingFileChangeToken = class
 interface IChangeToken
Public Class PollingFileChangeToken
Implements IChangeToken
Inheritance
PollingFileChangeToken
Implements

Remarks

Polling occurs every 4 seconds.

By default, this change token does not raise change callbacks. Callers should watch for HasChanged to turn from false to true. When ActiveChangeCallbacks is true, callbacks registered via RegisterChangeCallback(Action<Object>, Object) will be invoked when the file or directory changes.

Constructors

Name Description
PollingFileChangeToken(FileInfo)

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

Properties

Name Description
ActiveChangeCallbacks

Gets a value that indicates whether this token will proactively raise callbacks. If false, the token consumer must poll HasChanged to detect changes.

HasChanged

Gets a value that indicates whether the file or directory has changed since the change token was created.

Methods

Name Description
RegisterChangeCallback(Action<Object>, Object)

Registers a callback that will be invoked when the token changes, if ActiveChangeCallbacks is true. If ActiveChangeCallbacks is false, no callback is registered and an empty disposable is returned.

Applies to


Feedback

Was this page helpful?