dotnet-sdk icon indicating copy to clipboard operation
dotnet-sdk copied to clipboard

The status API supports direct storage and reading of byte arrays

Open saber-wang opened this issue 3 years ago • 2 comments
trafficstars

Describe the proposal

https://github.com/dapr/dotnet-sdk/blob/master/src/Dapr.Client/DaprClientGrpc.cs#L789

Can I simply add 2 methods, for example

Task<bool> TrySaveStateByteAsync(
            string storeName,
            string key,
            byte[] value,
            string etag,
            StateOptions stateOptions = default,
            IReadOnlyDictionary<string, string> metadata = default,
            CancellationToken cancellationToken = default)

Task<byte[]> GetStateByteAsync(
            string storeName,
            string key,
            ConsistencyMode? consistencyMode = default,
            IReadOnlyDictionary<string, string> metadata = default,
            CancellationToken cancellationToken = default)

saber-wang avatar Jul 11 '22 05:07 saber-wang

Just to clarify, this is asking for raw data from the state APIs instead of the Json path we have now?

halspang avatar Jul 11 '22 21:07 halspang

@halspang Yes, because the value may not be json

saber-wang avatar Jul 12 '22 03:07 saber-wang