Skip to content

OperationQueue class

Defined in

Namespace: Punchclock.Reactive Assembly: Punchclock.Reactive.dll Full name: Punchclock.Reactive.OperationQueue Modifiers: public

Summary

View source

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

NameSummary
.ctorInitializes a new instance of the [OperationQueue](# class.

Methods

NameSummary
EnqueueObservableOperationThis method enqueues an action to be run at a later time, according to the scheduling policies (i.e. via priority and key).
PauseQueueThis method pauses the dispatch queue. Inflight operations will not be canceled, but new ones will not be processed until the queue is resumed.
SetMaximumConcurrentSets the maximum level of concurrency for the operation queue. The queue is paused during the update to ensure consistency.
ShutdownQueueShuts down the queue and notifies when all outstanding items have been processed. After shutdown, no new operations can be enqueued.
Dispose
Inherited members

Extension members