Interface IBlobCache
- Namespace
- Akavache
- Assembly
- Akavache.dll
IBlobCache is the core database interface, 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, BsonReader uses a DateDateTimeKind, you can set this value.
HttpService
Gets or sets the HTTP service.
Property Value
- IHttp
Service The HTTP service.
Scheduler
Gets the IScheduler used to defer operations. By default, this is BlobCache.TaskpoolScheduler.
Property Value
- IScheduler
Serializer
Gets the serializer.
Property Value
- ISerializer
The serializer.
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.
Flush(Type)
This method guarantees that all in-flight inserts have completed and any indexes have been written to disk.
Parameters
typeTypeThe type.
Returns
- IObservable<Unit>
A signal indicating when the flush is complete.
Get(IEnumerable<string>)
Gets a observable of key value pairs with the specified keys with their corresponding values.
Parameters
keysIEnumerable<string>The keys to get the values for.
Returns
- IObservable<Key
Value <string, byte[]>>Pair A observable with the specified values.
Get(IEnumerable<string>, Type)
Gets a observable of key value pairs with the specified keys with their corresponding values.
Parameters
keysIEnumerable<string>The keys to get the values for.
typeTypeThe type.
Returns
- IObservable<Key
Value <string, byte[]>>Pair A observable with the specified values.
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
keystringThe key to return asynchronously.
Returns
- IObservable<byte[]>
A Future result representing the byte data.
Get(string, Type)
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
Returns
- IObservable<byte[]>
A Future result representing the byte data.
GetAll(Type)
Gets a observable of key value pairs with the specified keys with their corresponding values.
Parameters
typeTypeThe type.
Returns
- IObservable<Key
Value <string, byte[]>>Pair A observable with the specified values.
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<string>
A list of valid keys for the cache.
GetAllKeys(Type)
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.
Parameters
typeTypeThe type.
Returns
- IObservable<string>
A list of valid keys for the cache.
GetCreatedAt(IEnumerable<string>)
Gets a observable of key value pairs with the specified keys with their corresponding created Date
Parameters
keysIEnumerable<string>The keys to get the values for.
Returns
- IObservable<(string Key, Date
Time ? Time)>Offset A observable with the specified values.
GetCreatedAt(IEnumerable<string>, Type)
Gets a observable of key value pairs with the specified keys with their corresponding created Date
Parameters
keysIEnumerable<string>The keys to get the values for.
typeTypeThe type.
Returns
- IObservable<(string Key, Date
Time ? Time)>Offset A observable with the specified values.
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
keystringThe key to return the date for.
Returns
- IObservable<Date
Time ?>Offset The date the key was created on.
GetCreatedAt(string, Type)
Returns the time that the key was added to the cache, or returns null if the key isn't in the cache.
Parameters
Returns
- IObservable<Date
Time ?>Offset The date the key was created on.
Insert(IEnumerable<KeyValuePair<string, byte[]>>, DateTimeOffset?)
Inserts the specified key/value pairs into the blob.
IObservable<Unit> Insert(IEnumerable<KeyValuePair<string, byte[]>> keyValuePairs, DateTimeOffset? absoluteExpiration = null)
Parameters
keyValuePairsIEnumerable<KeyValue <string, byte[]>>Pair The key/value to insert.
absoluteExpirationDateTime ?Offset An optional expiration date.
Returns
- IObservable<Unit>
A observable which signals when complete.
Insert(IEnumerable<KeyValuePair<string, byte[]>>, Type, DateTimeOffset?)
Inserts the specified key/value pairs into the blob.
IObservable<Unit> Insert(IEnumerable<KeyValuePair<string, byte[]>> keyValuePairs, Type type, DateTimeOffset? absoluteExpiration = null)
Parameters
keyValuePairsIEnumerable<KeyValue <string, byte[]>>Pair The key/value to insert.
typeTypeThe type.
absoluteExpirationDateTime ?Offset An optional expiration date.
Returns
- IObservable<Unit>
A observable which signals when complete.
Insert(string, byte[], DateTimeOffset?)
Insert a blob into the cache with the specified key and expiration date.
Parameters
keystringThe key to use for the data.
databyte[]The data to save in the cache.
absoluteExpirationDateTime ?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.
Insert(string, byte[], Type, DateTimeOffset?)
Insert a blob into the cache with the specified key and expiration date.
IObservable<Unit> Insert(string key, byte[] data, Type type, DateTimeOffset? absoluteExpiration = null)
Parameters
keystringThe key to use for the data.
databyte[]The data to save in the cache.
typeTypeThe type.
absoluteExpirationDateTime ?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(IEnumerable<string>)
Invalidates all the entries at the specified keys, causing them in future to have to be re-fetched.
Parameters
keysIEnumerable<string>The keys to invalid.
Returns
- IObservable<Unit>
A observable which signals when complete.
Invalidate(IEnumerable<string>, Type)
Invalidates all the entries at the specified keys, causing them in future to have to be re-fetched.
Parameters
keysIEnumerable<string>The keys to invalid.
typeTypeThe type to invalidate.
Returns
- IObservable<Unit>
A observable which signals when complete.
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
keystringThe key to remove from the cache.
Returns
- IObservable<Unit>
A signal indicating when the invalidate is complete.
Invalidate(string, Type)
Remove a key from the cache. If the key doesn't exist, this method should do nothing and return (not throw KeyNotFoundException).
Parameters
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.
InvalidateAll(Type)
Invalidates all entries for the specified type.
Parameters
typeTypeThe type to invalidate.
Returns
- IObservable<Unit>
A signal indicating when the invalidate is complete.
UpdateExpiration(IEnumerable<string>, DateTimeOffset?)
Updates the expiration date for multiple existing cache entries without reading or writing the cached data. This is useful when a server returns a NotModified response and you want to extend the cache expiration.
Parameters
keysIEnumerable<string>The keys of the cache entries to update.
absoluteExpirationDateTime ?Offset The new expiration date. Pass null for no expiration.
Returns
- IObservable<Unit>
A signal indicating when the operation is complete.
UpdateExpiration(IEnumerable<string>, Type, DateTimeOffset?)
Updates the expiration date for multiple existing cache entries without reading or writing the cached data. This is useful when a server returns a NotModified response and you want to extend the cache expiration.
IObservable<Unit> UpdateExpiration(IEnumerable<string> keys, Type type, DateTimeOffset? absoluteExpiration)
Parameters
keysIEnumerable<string>The keys of the cache entries to update.
typeTypeThe type of the cached objects.
absoluteExpirationDateTime ?Offset The new expiration date. Pass null for no expiration.
Returns
- IObservable<Unit>
A signal indicating when the operation is complete.
UpdateExpiration(string, DateTimeOffset?)
Updates the expiration date for an existing cache entry without reading or writing the cached data. This is useful when a server returns a NotModified response and you want to extend the cache expiration.
Parameters
keystringThe key of the cache entry to update.
absoluteExpirationDateTime ?Offset The new expiration date. Pass null for no expiration.
Returns
- IObservable<Unit>
A signal indicating when the operation is complete.
UpdateExpiration(string, Type, DateTimeOffset?)
Updates the expiration date for an existing cache entry without reading or writing the cached data. This is useful when a server returns a NotModified response and you want to extend the cache expiration.
Parameters
keystringThe key of the cache entry to update.
typeTypeThe type of the cached object.
absoluteExpirationDateTime ?Offset The new expiration date. Pass null for no expiration.
Returns
- IObservable<Unit>
A signal indicating when the operation 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.