Interface IScheduleTask<TKey>
Represents a reactive task that can be registered in ReactiveScheduler<TKey>.
public interface IScheduleTask<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
Methods
InvokeAsync(IReactiveScheduler<TKey>, ReactiveTaskInvocationParams, CancellationToken)
Invokes the task.
Task InvokeAsync(IReactiveScheduler<TKey> scheduler, ReactiveTaskInvocationParams parameters, CancellationToken cancellationToken)
Parameters
scheduler
IReactiveScheduler<TKey>Source scheduler.
parameters
ReactiveTaskInvocationParamsInvocation parameters.
cancellationToken
CancellationTokenCancellationToken instance.
Returns
OnCompleted(IReactiveScheduler<TKey>, ReactiveTaskCompletionParams)
Callback for task invocation completion.
void OnCompleted(IReactiveScheduler<TKey> scheduler, ReactiveTaskCompletionParams parameters)
Parameters
scheduler
IReactiveScheduler<TKey>Source scheduler.
parameters
ReactiveTaskCompletionParamsCompletion parameters.
OnEnqueue(IReactiveScheduler<TKey>, ReactiveTaskInvocationParams, int)
Callback invoked before the task invocation gets enqueued due to maximum concurrency.
bool OnEnqueue(IReactiveScheduler<TKey> scheduler, ReactiveTaskInvocationParams parameters, int positionInQueue)
Parameters
scheduler
IReactiveScheduler<TKey>Source scheduler.
parameters
ReactiveTaskInvocationParamsInvocation parameters.
positionInQueue
intInvocation's position in queue.
Returns
- bool
true to proceed with enqueueing, false to cancel the invocation.