Class Cache<TKey, TValue>
Provides access to a named group of objects that can be shared across multiple clients.
Inherited Members
Namespace: Scaleout.Client
Assembly: Scaleout.Client.dll
Syntax
public class Cache<TKey, TValue> : Cache
Type Parameters
Name | Description |
---|---|
TKey | The type of keys in the cache. |
TValue | The type of values in the cache. |
Properties
Name | Description |
---|---|
Id | Gets the ID associated with this cache in the ScaleOut service. |
Name | Gets the name associated with this cache. |
Methods
Name | Description |
---|---|
Add(TKey, TValue, CreatePolicy, IEnumerable<String>, CancellationToken) | Adds an object in the cache. |
AddAsync(TKey, TValue, CreatePolicy, IEnumerable<String>, CancellationToken) | Adds an object in the cache. |
AddExclusive(TKey, TValue, CreatePolicy, IEnumerable<String>, CancellationToken) | Add an object in the cache and exclusively locks it, returning a CacheResponse<TKey, TValue> containing a lock token. |
AddExclusiveAsync(TKey, TValue, CreatePolicy, IEnumerable<String>, CancellationToken) | Add an object in the cache and exclusively locks it, returning a CacheResponse<TKey, TValue> containing a lock token. |
AddOrUpdate(TKey, TValue, CreatePolicy, IEnumerable<String>, CancellationToken) | Adds or updates an object in the cache. |
AddOrUpdateAsync(TKey, TValue, CreatePolicy, IEnumerable<String>, CancellationToken) | Adds or updates an object in the cache. |
Clear(CancellationToken) | Clears all objects from the cache. |
ClearAsync(CancellationToken) | Clears all objects from the cache. |
GetExclusiveLock(TKey, CancellationToken) | Acquires an exclusive lock on an object in the cache. |
GetExclusiveLockAsync(TKey, CancellationToken) | Acquires an exclusive lock on an object in the cache. |
GetMetadata(TKey, CancellationToken) | Gets server metadata for an object stored in the ScaleOut service. |
GetMetadataAsync(TKey, CancellationToken) | Gets server metadata for an object stored in the ScaleOut service. |
GetPolicyBuilder() | Get a CreatePolicyBuilder instance with policies pre-set with this cache's defaults. |
Invoke(String, Byte[], Nullable<TimeSpan>) | Invokes a server-side parallel method invocation operation against all objects in the cache. |
Invoke(String, Byte[], String, Nullable<TimeSpan>) | Invokes a server-side parallel method invocation operation against all objects in the cache. The operation will be handled remotely on ScaleOut hosts in an Invocation Grid worker process. |
Invoke(String, Byte[], UInt32, Nullable<TimeSpan>) | Invokes a server-side parallel method invocation operation against all objects in the cache. The operation will be handled remotely on ScaleOut hosts in an Invocation Grid worker process. (This overload is typically only used to support internal product infrastructure.) |
InvokeAsync(String, Byte[], Nullable<TimeSpan>) | Asynchronously invokes a server-side parallel method invocation operation against all objects in the cache. |
InvokeAsync(String, Byte[], String, Nullable<TimeSpan>) | Asynchronously invokes a server-side parallel method invocation operation against all objects in the cache. The operation will be handled remotely on ScaleOut hosts in an Invocation Grid worker process. |
InvokeAsync(String, Byte[], UInt32, Nullable<TimeSpan>) | Asynchronously invokes a server-side parallel method invocation operation against all objects in the cache. The operation will be handled remotely on ScaleOut hosts in an Invocation Grid worker process. (This overload is typically only used to support internal product infrastructure.) |
PostEvent(TKey, String, Byte[], Nullable<TimeSpan>) | Posts an event that is associated with a StateServer object. The event will be handled remotely on the host where the object resides by an Invocation Grid worker process. |
PostEvent(TKey, String, Byte[], String, Nullable<TimeSpan>) | Posts an event that is associated with a StateServer object. The event will be handled remotely on the host where the object resides. |
PostEvent(TKey, String, Byte[], UInt32, Nullable<TimeSpan>) | Posts an event that is associated with a StateServer object. The event will be handled remotely on the host where the object resides by an Invocation Grid worker process. (This overload is typically only used to support internal product infrastructure.) |
PostEventAsync(TKey, String, Byte[], Nullable<TimeSpan>) | Posts an event that is associated with a StateServer object. The event will be handled remotely on the host where the object resides. |
PostEventAsync(TKey, String, Byte[], String, Nullable<TimeSpan>) | Posts an event that is associated with a StateServer object. The event will be handled remotely on the host where the object resides by an Invocation Grid worker process. |
PostEventAsync(TKey, String, Byte[], UInt32, Nullable<TimeSpan>) | Posts an event that is associated with a StateServer object. The event will be handled remotely on the host where the object resides by an Invocation Grid worker process. (This overload is typically only used to support internal product infrastructure.) |
QueryObjectCount() | Retrieves a count of objects in the cache. |
QueryObjectCountAsync() | Retrieves a count of objects in the cache. |
QueryObjects() | Gets an IQueryable that can be used to construct a LINQ query expression. |
Read(TKey, ReadOptions, CancellationToken) | Retrieves an existing object from the cache. |
ReadAsync(TKey, ReadOptions, CancellationToken) | Retrieves an existing object from the cache. |
ReadExclusive(TKey, ReadOptions, CancellationToken) | Retrieves and acquires an exclusive lock on an existing object in the cache. |
ReadExclusiveAsync(TKey, ReadOptions, CancellationToken) | Retrieves and acquires an exclusive lock on an existing object in the cache. |
ReadExclusiveOrAdd(TKey, Func<TValue>, ReadOptions, CancellationToken) | Reads an object from the cache, adding it if it does not already exist, and acquires an exclusive lock on the object if the operation results in a read. When adding, callers are synchronized by the ScaleOut service so that only the first caller performs the add operation. |
ReadExclusiveOrAdd(Func<TKey, ValueFactoryResult<TValue>>, TKey, ReadOptions, CancellationToken) | Reads an object from the cache, adding it if it does not already exist, and acquires an exclusive lock on the object if the operation results in a read. When adding, callers are synchronized by the ScaleOut service so that only the first caller performs the add operation. |
ReadExclusiveOrAddAsync(TKey, Func<TKey, ValueFactoryResult<TValue>>, ReadOptions, CancellationToken) | Reads an object from the cache, adding it if it does not already exist, and acquires an exclusive lock on the object if the operation results in a read. When adding, callers are synchronized by the ScaleOut service so that only the first caller performs the add operation. |
ReadExclusiveOrAddAsync(TKey, Func<TValue>, ReadOptions, CancellationToken) | Reads an object from the cache, adding it if it does not already exist, and acquires an exclusive lock on the object if the operation results in a read. When adding, callers are synchronized by the ScaleOut service so that only the first caller performs the add operation. |
ReadExclusiveOrAddAsync(Func<TKey, Task<ValueFactoryResult<TValue>>>, TKey, ReadOptions, CancellationToken) | Reads an object from the cache, adding it if it does not already exist, and acquires an exclusive lock on the object if the operation results in a read. When adding, callers are synchronized by the ScaleOut service so that only the first caller performs the add operation. |
ReadLocked(TKey, LockToken, ReadOptions, CancellationToken) | Retrieves an existing object in the cache that is already locked by the caller, retaining the lock for subsequent locking operations. |
ReadLockedAsync(TKey, LockToken, ReadOptions, CancellationToken) | Retrieves an existing object in the cache that is already locked by the caller, retaining the lock for subsequent locking operations. |
ReadOrAdd(TKey, Func<TValue>, ReadOptions, CancellationToken) | Reads an object from the cache, adding it if it does not already exist. When adding, callers are synchronized by the ScaleOut service so that only the first caller performs the add operation. |
ReadOrAdd(Func<TKey, ValueFactoryResult<TValue>>, TKey, ReadOptions, CancellationToken) | Reads an object from the cache, adding it if it does not already exist. When adding, callers are synchronized by the ScaleOut service so that only the first performs the add operation. |
ReadOrAddAsync(TKey, Func<TKey, ValueFactoryResult<TValue>>, ReadOptions, CancellationToken) | Reads an object from the cache, adding it if it does not already exist. When adding, callers are synchronized by the ScaleOut service so that only the first caller performs the add operation. |
ReadOrAddAsync(TKey, Func<TValue>, ReadOptions, CancellationToken) | Reads an object from the cache, adding it if it does not already exist. When adding, callers are synchronized by the ScaleOut service so that only the first caller performs the add operation. |
ReadOrAddAsync(Func<TKey, Task<ValueFactoryResult<TValue>>>, TKey, ReadOptions, CancellationToken) | Reads an object from the cache, adding it if it does not already exist. When adding, callers are synchronized by the ScaleOut service so that only the first performs the add operation. |
RefreshExclusiveLock(TKey, LockToken, CancellationToken) | Refreshes a lock that is already held by the caller on an existing object in the cache. |
RefreshExclusiveLockAsync(TKey, LockToken, CancellationToken) | Refreshes a lock that is already held by the caller on an existing object in the cache. |
ReleaseExclusiveLock(TKey, LockToken, CancellationToken) | Releases a lock that is already held by the caller on an existing object in the cache. |
ReleaseExclusiveLockAsync(TKey, LockToken, CancellationToken) | Releases a lock that is already held by the caller on an existing object in the cache. |
Remove(TKey, CancellationToken) | Removes an object from the cache. |
RemoveAsync(TKey, CancellationToken) | Removes an object from the cache. |
RemoveLocked(TKey, LockToken, CancellationToken) | Removes a locked object from the cache. |
RemoveLockedAsync(TKey, LockToken, CancellationToken) | Removes a locked object from the cache. |
RemoveOptimistic(TKey, VersionToken, CancellationToken) | Removes an object from the cache using optimistic concurrency. |
RemoveOptimisticAsync(TKey, VersionToken, CancellationToken) | Removes an object from the cache using optimistic concurrency. |
SingleObjectInvoke(TKey, String, Byte[], Nullable<TimeSpan>) | Invokes a server-side operation on a single, targeted StateServer object. The operation will be run remotely on the host where the object resides. |
SingleObjectInvoke(TKey, String, Byte[], String, Nullable<TimeSpan>) | Invokes a server-side operation on a single, targeted StateServer object. The operation will be run remotely on the host where the object resides by an Invocation Grid worker process. |
SingleObjectInvoke(TKey, String, Byte[], UInt32, Nullable<TimeSpan>) | Invokes a server-side operation on a single, targeted StateServer object. The operation will be run remotely on the host where the object resides by an Invocation Grid worker process. (This overload is typically only used to support internal product infrastructure.) |
SingleObjectInvokeAsync(TKey, String, Byte[], Nullable<TimeSpan>) | Invokes a server-side operation on a single, targeted StateServer object. The operation will be run remotely on the host where the object resides. |
SingleObjectInvokeAsync(TKey, String, Byte[], String, Nullable<TimeSpan>) | Invokes a server-side operation on a single, targeted StateServer object. The operation will be run remotely on the host where the object resides by an Invocation Grid worker process. |
SingleObjectInvokeAsync(TKey, String, Byte[], UInt32, Nullable<TimeSpan>) | Invokes a server-side operation on a single, targeted StateServer object. The operation will be run remotely on the host where the object resides by an Invocation Grid worker process. (This overload is typically only used to support internal product infrastructure.) |
TryReadExclusive(TKey, ReadOptions, CancellationToken) | Attempts to read and acquire an exclusive lock on an existing object in the cache. This method does not block if the object is locked by another caller--it returns immediately with Result set to AlreadyLockedError. |
TryReadExclusiveAsync(TKey, ReadOptions, CancellationToken) | Attempts to read and acquire an exclusive lock on an existing object in the cache. This method does not block if the object is locked by another caller--it returns immediately with Result set to AlreadyLockedError. |
Update(TKey, TValue, UpdatePolicy, IEnumerable<String>, CancellationToken) | Updates an existing object in the cache. |
UpdateAndReleaseExclusive(TKey, TValue, LockToken, UpdatePolicy, IEnumerable<String>, CancellationToken) | Updates an existing object in the cache that is already locked by the caller and releases the lock on the object. |
UpdateAndReleaseExclusiveAsync(TKey, TValue, LockToken, UpdatePolicy, IEnumerable<String>, CancellationToken) | Updates an existing object in the cache that is already locked by the caller and releases the lock on the object. |
UpdateAndRetainExclusive(TKey, TValue, LockToken, UpdatePolicy, IEnumerable<String>, CancellationToken) | Updates an existing object in the cache that is already locked by the caller, retaining the lock for subsequent locking operations. |
UpdateAndRetainExclusiveAsync(TKey, TValue, LockToken, UpdatePolicy, IEnumerable<String>, CancellationToken) | Updates an existing object in the cache that is already locked by the caller, retaining the lock for subsequent locking operations. |
UpdateAsync(TKey, TValue, UpdatePolicy, IEnumerable<String>, CancellationToken) | Updates an existing object in the cache. |
UpdateOptimistic(TKey, TValue, VersionToken, UpdatePolicy, IEnumerable<String>, CancellationToken) | Updates an existing object in the cache using optimistic concurrency. |
UpdateOptimisticAsync(TKey, TValue, VersionToken, UpdatePolicy, IEnumerable<String>, CancellationToken) | Updates an existing object in the cache using optimistic concurrency. |