Interface ITimerTask<TKey>
Represents a reactive task that can be registered in an IEventStream<TEvent> with WithInterval<TEvent> events.
public interface ITimerTask<TKey> : IDisposable where TKey : notnull
Type Parameters
TKey
Task key type.
- Inherited Members
Properties
Key
Underlying key.
TKey Key { get; }
Property Value
- TKey
MaxConcurrentInvocations
Specifies the maximum number of concurrently running invocations.
int MaxConcurrentInvocations { get; }
Property Value
MaxEnqueuedInvocations
Specifies the maximum number of invocations that can be enqueued due to maximum concurrency.
int MaxEnqueuedInvocations { get; }
Property Value
NextInvocationTimestamp
Specifies the Timestamp of the next task invocation. Lack of value means that the task will be invoked on every event stream's event.
Timestamp? NextInvocationTimestamp { get; }
Property Value
Methods
InvokeAsync(TimerTaskCollection<TKey>, ReactiveTaskInvocationParams, CancellationToken)
Invokes the task.
Task InvokeAsync(TimerTaskCollection<TKey> source, ReactiveTaskInvocationParams parameters, CancellationToken cancellationToken)
Parameters
source
TimerTaskCollection<TKey>Source timer task collection.
parameters
ReactiveTaskInvocationParamsInvocation parameters.
cancellationToken
CancellationTokenCancellationToken instance.
Returns
OnCompleted(TimerTaskCollection<TKey>, ReactiveTaskCompletionParams)
Callback for task invocation completion.
void OnCompleted(TimerTaskCollection<TKey> source, ReactiveTaskCompletionParams parameters)
Parameters
source
TimerTaskCollection<TKey>Source timer task collection.
parameters
ReactiveTaskCompletionParamsCompletion parameters.
OnEnqueue(TimerTaskCollection<TKey>, ReactiveTaskInvocationParams, int)
Callback invoked before the task invocation gets enqueued due to maximum concurrency.
bool OnEnqueue(TimerTaskCollection<TKey> source, ReactiveTaskInvocationParams parameters, int positionInQueue)
Parameters
source
TimerTaskCollection<TKey>Source timer task collection.
parameters
ReactiveTaskInvocationParamsInvocation parameters.
positionInQueue
intInvocation's position in queue.
Returns
- bool
true to proceed with enqueueing, false to cancel the invocation.