Skip to content

BatchWorker

class

Namespace: Orleans

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.
public abstract class BatchWorker

Methods

  • IsIdle Check if this worker is idle.
  • Notify Notify the worker that there is more work.
  • Notify(DateTime) Instructs the batch worker to run again to check for work, if it has not run again already by then, at specified utcTime.
  • 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.
  • WaitForCurrentWorkToBeServiced Wait for the current work cycle, and also the next work cycle if there is currently unserviced work.