Skip to content

Commit d8157b9

Browse files
authoredMar 31, 2020
Consuming proto files for 0.6.0 dapr runtime and updating DaprClient for it. (#274)
1 parent 20fabb2 commit d8157b9

File tree

3 files changed

+3
-53
lines changed

3 files changed

+3
-53
lines changed
 

‎src/Dapr.Client/DaprClientGrpc.cs

+1-39
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ internal async ValueTask MakeSaveStateCallAsync<TValue>(
364364

365365
if (stateOptions != null)
366366
{
367-
stateRequest.Options = ToAutoGeneratedStateRequestOptions(stateOptions);
367+
stateRequest.Options = ToAutoGeneratedStateOptions(stateOptions);
368368
}
369369

370370
if (value != null)
@@ -506,44 +506,6 @@ private async Task<TResponse> MakeGrpcCallHandleError<TResponse>(Func<CallOption
506506
return await callFunc.Invoke(callOptions);
507507
}
508508

509-
private StateRequestOptions ToAutoGeneratedStateRequestOptions(StateOptions stateOptions)
510-
{
511-
var stateRequestOptions = new Autogenerated.StateRequestOptions();
512-
513-
if (stateOptions.Consistency != null)
514-
{
515-
stateRequestOptions.Consistency = GetStringForConsistencyMode(stateOptions.Consistency.Value);
516-
}
517-
518-
if (stateOptions.Concurrency != null)
519-
{
520-
stateRequestOptions.Concurrency = GetStringForConcurrencyMode(stateOptions.Concurrency.Value);
521-
}
522-
523-
if (stateOptions.RetryOptions != null)
524-
{
525-
var retryPolicy = new Autogenerated.StateRetryPolicy();
526-
if (stateOptions.RetryOptions.RetryMode != null)
527-
{
528-
retryPolicy.Pattern = GetStringForRetryMode(stateOptions.RetryOptions.RetryMode.Value);
529-
}
530-
531-
if (stateOptions.RetryOptions.RetryInterval != null)
532-
{
533-
retryPolicy.Interval = Duration.FromTimeSpan(stateOptions.RetryOptions.RetryInterval.Value);
534-
}
535-
536-
if (stateOptions.RetryOptions.RetryThreshold != null)
537-
{
538-
retryPolicy.Threshold = stateOptions.RetryOptions.RetryThreshold.Value;
539-
}
540-
541-
stateRequestOptions.RetryPolicy = retryPolicy;
542-
}
543-
544-
return stateRequestOptions;
545-
}
546-
547509
private Autogenerated.StateOptions ToAutoGeneratedStateOptions(StateOptions stateOptions)
548510
{
549511
var stateRequestOptions = new Autogenerated.StateOptions();

‎src/Dapr.Client/Protos/dapr.proto

+1-13
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,5 @@ message StateRequest {
104104
google.protobuf.Any value = 2;
105105
string etag = 3;
106106
map<string,string> metadata = 4;
107-
StateRequestOptions options = 5;
108-
}
109-
110-
message StateRequestOptions {
111-
string concurrency = 1;
112-
string consistency = 2;
113-
StateRetryPolicy retryPolicy = 3;
114-
}
115-
116-
message StateRetryPolicy {
117-
int32 threshold = 1;
118-
string pattern = 2;
119-
google.protobuf.Duration interval = 3;
107+
StateOptions options = 5;
120108
}

‎src/Dapr.Client/Protos/daprclient.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ message RetryPolicy {
7373
int32 threshold = 1;
7474
string pattern = 2;
7575
google.protobuf.Duration interval = 3;
76-
}
76+
}

0 commit comments

Comments
 (0)
Please sign in to comment.