Exemple #1
0
        protected virtual async IAsyncEnumerable <TResponse> StreamService <TRequest, TResponse>(IStreamService <TRequest, TResponse> service,
                                                                                                 TRequest request, [EnumeratorCancellation] CancellationToken cancel)
        {
            var response = service.Stream(request, cancel);

            await foreach (var item in response.WithCancellation(cancel))
            {
                yield return(item);
            }
        }
Exemple #2
0
 public async Task Echo()
 {
     await _streamer.Stream("test");
 }