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); } }
public async Task Echo() { await _streamer.Stream("test"); }