OperationQueue class¶
Defined in
Namespace: Punchclock.Reactive
Assembly: Punchclock.Reactive.dll
Full name: Punchclock.Reactive.OperationQueue
Modifiers: public
Summary¶
OperationQueue is the core of PunchClock, and represents a scheduler for deferred actions, such as network requests. This scheduler supports scheduling via priorities, as well as serializing requests that access the same data.
The queue allows a fixed number of concurrent in-flight operations at a time. When there are available "slots", items are dispatched as they come in. When the slots are full, the queueing policy starts to apply.
The queue, similar to Akavache's KeyedOperationQueue, also allows keys to be specified to serialize operations - if you have three "foo" items, they will wait in line and only one "foo" can run. However, a "bar" and "baz" item can run at the same time as a "foo" item.
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481
Class hierarchy
classDiagram
class OperationQueue
class IDisposable {
<>
}
IDisposable <|.. OperationQueue
Implements: IDisposable
Constructors¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [OperationQueue](# class. |
Methods¶
| Name | Summary |
|---|---|
| EnqueueObservableOperation | This method enqueues an action to be run at a later time, according to the scheduling policies (i.e. via priority and key). |
| PauseQueue | This method pauses the dispatch queue. Inflight operations will not be canceled, but new ones will not be processed until the queue is resumed. |
| SetMaximumConcurrent | Sets the maximum level of concurrency for the operation queue. The queue is paused during the update to ensure consistency. |
| ShutdownQueue | Shuts down the queue and notifies when all outstanding items have been processed. After shutdown, no new operations can be enqueued. |
| Dispose |