Class KeyedOperationQueue
- Namespace
- Akavache
- Assembly
- Akavache.Core.dll
A key which has separate buckets for each key.
public class KeyedOperationQueue : IKeyedOperationQueue, IEnableLogger, IDisposable
- Inheritance
-
KeyedOperationQueue
- Implements
- Extension Methods
Constructors
KeyedOperationQueue(IScheduler?)
Initializes a new instance of the KeyedOperationQueue class.
public KeyedOperationQueue(IScheduler? scheduler = null)
Parameters
scheduler
ISchedulerThe scheduler for Observable operations.
Methods
Dispose()
public void Dispose()
Dispose(bool)
Disposes of managed memory for the class.
protected virtual void Dispose(bool disposing)
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.
public IObservable<Unit> EnqueueOperation(string key, Action action)
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.
public IObservable<T> EnqueueOperation<T>(string key, Func<T> calculationFunc)
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.
public IObservable<Unit> ShutdownQueue()
Returns
- IObservable<Unit>
An observable that signals when the shutdown is complete.