Interface IBlobCache
- Namespace
- Akavache
- Assembly
- Akavache.Core.dll
IBlobCache is the core interface on which Akavache is built, it is an interface describing an asynchronous persistent key-value store.
- Inherited Members
- Extension Methods
Properties
ForcedDateTimeKind
Gets or sets the DateTimeKind handling for BSON readers to be forced.
Property Value
Remarks
By default, Newtonsoft.DateTimeKind
, you can set this value.
Scheduler
Gets the IScheduler used to defer operations. By default, this is BlobCache.TaskpoolScheduler.
Property Value
- IScheduler
Shutdown
Gets an Observable that fires after the Dispose completes successfully, since there is no such thing as an AsyncDispose().
Property Value
- IObservable<Unit>
Methods
Flush()
This method guarantees that all in-flight inserts have completed and any indexes have been written to disk.
Returns
- IObservable<Unit>
A signal indicating when the flush is complete.
Get(string)
Retrieve a value from the key-value cache. If the key is not in the cache, this method should return an IObservable which OnError's with KeyNotFoundException.
Parameters
key
stringThe key to return asynchronously.
Returns
- IObservable<byte[]>
A Future result representing the byte data.
GetAllKeys()
Return all keys in the cache. Note that this method is normally for diagnostic / testing purposes, and that it is not guaranteed to be accurate with respect to in-flight requests.
Returns
- IObservable<IEnumerable<string>>
A list of valid keys for the cache.
GetCreatedAt(string)
Returns the time that the key was added to the cache, or returns null if the key isn't in the cache.
Parameters
key
stringThe key to return the date for.
Returns
- IObservable<Date
Time ?>Offset The date the key was created on.
Insert(string, byte[], DateTimeOffset?)
Insert a blob into the cache with the specified key and expiration date.
Parameters
key
stringThe key to use for the data.
data
byte[]The data to save in the cache.
absoluteExpiration
DateTime ?Offset An optional expiration date. After the specified date, the key-value pair should be removed.
Returns
- IObservable<Unit>
A signal to indicate when the key has been inserted.
Invalidate(string)
Remove a key from the cache. If the key doesn't exist, this method should do nothing and return (not throw KeyNotFoundException).
Parameters
key
stringThe key to remove from the cache.
Returns
- IObservable<Unit>
A signal indicating when the invalidate is complete.
InvalidateAll()
Invalidate all entries in the cache (i.e. clear it). Note that this method is blocking and incurs a significant performance penalty if used while the cache is being used on other threads.
Returns
- IObservable<Unit>
A signal indicating when the invalidate is complete.
Vacuum()
This method eagerly removes all expired keys from the blob cache, as well as does any cleanup operations that makes sense (Hint: on SQLite3 it does a Vacuum).
Returns
- IObservable<Unit>
A signal indicating when the operation is complete.