Class KeyedOperationQueue
- Namespace
- Akavache
- Assembly
- Akavache.Core.dll
A key which has separate buckets for each key.
- Inheritance
-
Keyed
Operation Queue
- Implements
- Extension Methods
Constructors
KeyedOperationQueue(IScheduler?)
Initializes a new instance of the Keyed
Parameters
scheduler
ISchedulerThe scheduler for Observable operations.
Methods
Dispose()
Dispose(bool)
Disposes of managed memory for the class.
Parameters
disposing
boolIf this method is being called by the Dispose method.
EnqueueObservableOperation<T>(string, Func<IObservable<T>>)
Queue an operation to run in the background that returns a stream of values. All operations with the same key will run in sequence, waiting for the previous operation to complete. If you want to queue an operation that already returns IObservable, this is your guy.
public IObservable<T> EnqueueObservableOperation<T>(string key, Func<IObservable<T>> asyncCalculationFunc)
Parameters
key
stringThe key to use.
asyncCalculationFunc
Func<IObservable<T>>A method to run in the background that returns a stream of values.
Returns
- IObservable<T>
A future stream of values.
Type Parameters
T
The type of value in the queue.
EnqueueOperation(string, Action)
Queue an operation to run in the background. All operations with the same key will run in sequence, waiting for the previous operation to complete.
Parameters
Returns
- IObservable<Unit>
A future representing when the operation completes.
EnqueueOperation<T>(string, Func<T>)
Queue an operation to run in the background that returns a value. All operations with the same key will run in sequence, waiting for the previous operation to complete.
Parameters
key
stringThe key to use.
calculationFunc
Func<T>A method to run in the background that returns a single value.
Returns
- IObservable<T>
A future value.
Type Parameters
T
The type of item in the queue.
ShutdownQueue()
Shuts the queue and stops it from processing.
Returns
- IObservable<Unit>
An observable that signals when the shutdown is complete.