Table of Contents

Method GetAsync

Namespace
NATS.Client.ObjectStore
Assembly
NATS.Client.ObjectStore.dll

GetAsync(string, Stream, bool, CancellationToken)

Get object by key.

ValueTask<ObjectMetadata> GetAsync(string key, Stream stream, bool leaveOpen = false, CancellationToken cancellationToken = default)

Parameters

key string

Object key.

stream Stream

Stream to write the object value to.

leaveOpen bool

true to not close the underlying stream when async method returns; otherwise, false

cancellationToken CancellationToken

A CancellationToken used to cancel the API call.

Returns

ValueTask<ObjectMetadata>

Object metadata.

Exceptions

NatsObjException

Metadata didn't match the value retrieved e.g. the SHA digest.