PollingFileChangeToken class

A change token that polls for file changes.

This token checks the file's last modified time at regular intervals to detect changes and invokes registered callbacks when changes occur.

Implemented types

Constructors

PollingFileChangeToken(File _file, {Duration pollingInterval = const Duration(seconds: 4), CancellationTokenSource? cancellationTokenSource})
Creates a new PollingFileChangeToken for the specified file.

Properties

activeChangeCallbacks bool
Indicates if this token will pro-actively raise callbacks. If false, the token consumer must poll hasChanged to detect changes.
no setteroverride
hasChanged bool
Gets a value that indicates if a change has occurred.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerChangeCallback(void callback(Object? state), Object? state) IDisposable
Registers for a callback that will be invoked when the entry has changed. hasChanged MUST be set before the callback is invoked.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited