Exemple #1
0
 private static Task<ValueResponse> SendValuesThoughRpcAsync(ValueRequest request, MessageContext context)
 {
     return Task.FromResult(new ValueResponse
     {
         Value = $"value{request.Value}"
     });
 }
Exemple #2
0
 private static Task ServeValuesAsync(ValuesRequested message, MessageContext context)
 {
     var values = new List<string>();
     for (var i = 0; i < message.NumberOfValues; i++)
     {
         values.Add($"value{i}");
     }
     return _client.PublishAsync(new ValuesCalculated {Values = values}, context.GlobalRequestId);
 }