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.
public CacheResponse<TKey, TValue> TryReadExclusive(TKey key, ReadOptions options = default(ReadOptions), CancellationToken cancellationToken = default(CancellationToken))
Identifier of the object in the cache.
Options that can be used when retrieving an object from the ScaleOut service.
A token used to propagate notification that this operation should be canceled.
A CacheResponse<TKey, TValue> containing the outcome of the operation, the lock token, and the retrieved object (if successful).
|Retrieved||The object was successfully retrieved and locked in the ScaleOut service.|
|NotFound||The requested object was not found in the ScaleOut service.|
|AlreadyLockedError||The requested object could not be read because it was already locked in the ScaleOut service by another caller.|
Use the lock token on the response's LockToken property to perform subsequent operations under the lock.