Class DelayChangeToken
- Namespace
- Acuit.Pinpoint.ResourceManagement
- Assembly
- Acuit.Pinpoint.ResourceManagement.Abstractions.dll
A change token that indicates change after a time delay.
public sealed class DelayChangeToken : IChangeToken, IDisposable
- Inheritance
-
DelayChangeToken
- Implements
- Inherited Members
Constructors
DelayChangeToken(TimeSpan, ITimeService)
Initializes a new instance of the DelayChangeToken class.
public DelayChangeToken(TimeSpan delay, ITimeService timeService)
Parameters
delay
TimeSpanThe time span to wait before indicating change via the change token.
timeService
ITimeServiceThe time service.
Remarks
If delay
is Zero, then the change token will immediately indicate change.
Otherwise, the time delay will begin immediately, after which the change token will indicate change.
Exceptions
- ArgumentNullException
timeService
is null.- ArgumentOutOfRangeException
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
HasChanged
Gets a value that indicates if a change has occurred.
public bool HasChanged { get; }
Property Value
Methods
Dispose()
Closes and releases all resources used by the object.
public void Dispose()
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
Returns
- IDisposable
An IDisposable that is used to unregister the callback.