Table of Contents

Method ReadAsync

Namespace
Scaleout.Client
Assembly
Scaleout.Client.dll

ReadAsync(TKey, ReadOptions, CancellationToken)

Retrieves an existing object from the cache.

public Task<CacheResponse<TKey, TValue>> ReadAsync(TKey key, ReadOptions options = default, CancellationToken cancellationToken = default)

Parameters

key TKey

Identifier of the object in the cache.

options ReadOptions

Options that can be used when retrieving an object from the ScaleOut service.

cancellationToken CancellationToken

A token used to propagate notification that this operation should be canceled.

Returns

Task<CacheResponse<TKey, TValue>>

A CacheResponse<TKey, TValue> containing the outcome of the operation and the retrieved object (if successful).

Remarks

The Result property of the response will contain one of the following ServerResult outcomes:

ServerResultDescription
RetrievedThe object was successfully retrieved from the ScaleOut service.
NotFoundThe requested object was not found in the ScaleOut service.
RetrievedStale If GeoServer Pull replication is used but the WAN link between datacenters is down, RetrievedStale is returned to indicate that the proxy returned from the local ScaleOut service may be stale.

This operation does not use locking and will not block if another client/thread holds an exclusive lock on the object in the ScaleOut service. Use an exclusive variant to perform a synchronized read operation.