Skip to content

BatchWorker Methods

General pattern for an asynchronous worker that performs a work task, when notified, to service queued work. Each work cycle handles ALL the queued work. If new work arrives during a work cycle, another cycle is scheduled. The worker never executes more than one instance of the work cycle at a time, and consumes no resources when idle. It uses TaskScheduler.Current to schedule the work cycles.

Notify(DateTime)

View source
public void Notify(DateTime utcTime)
Instructs the batch worker to run again to check for work, if it has not run again already by then, at specified utcTime.

Parameters

utcTimeDateTime

NotifyAndWaitForWorkToBeServiced

View source
public Task NotifyAndWaitForWorkToBeServiced()
Notify the worker that there is more work, and wait for the current work cycle, and also the next work cycle if there is currently unserviced work.