# BatchWorker

Package: [Microsoft.Orleans.Core](/orleans/docs/api/csharp/microsoft.orleans.core/) 10.0.0

[NuGet package](https://www.nuget.org/packages/Microsoft.Orleans.Core) | [Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core/Async/BatchWorker.cs#L16)

```csharp
public abstract class BatchWorker
```

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.

## Methods

- [IsIdle](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.batchworker/methods/isidle-b8d46585/)
- [Notify](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.batchworker/methods/notify-6b9dd860/)
- [Notify(DateTime)](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.batchworker/methods/notify-system-datetime-4873ee36/)
- [NotifyAndWaitForWorkToBeServiced](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.batchworker/methods/notifyandwaitforworktobeserviced-8d56fe2a/)
- [WaitForCurrentWorkToBeServiced](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.batchworker/methods/waitforcurrentworktobeserviced-d81010a5/)
