public async Task <List <MeteoriteLanding> > StreamLargePayloadAsync() { List <MeteoriteLanding> meteoriteLandings = new List <MeteoriteLanding>(); using var call = client.GetLargePayload(new EmptyRequest()); while (await call.ResponseStream.MoveNext()) { meteoriteLandings.Add(call.ResponseStream.Current); } return(meteoriteLandings); }
public async Task <List <MeteoriteLanding> > StreamLargePayloadAsync() { List <MeteoriteLanding> meteoriteLandings = new List <MeteoriteLanding>(); using (var response = client.GetLargePayload(new EmptyRequest()).ResponseStream) { while (await response.MoveNext()) { meteoriteLandings.Add(response.Current); } } return(meteoriteLandings); }
public override async Task GetLargePayload(EmptyRequest request, IServerStreamWriter <MeteoriteLanding> responseStream, ServerCallContext context) { /* * foreach (var meteoriteLanding in MeteoriteLandingData.GrpcMeteoriteLandings) * { * await responseStream.WriteAsync(meteoriteLanding); * } */ List <MeteoriteLanding> meteoriteLandings = new List <MeteoriteLanding>(); using (var response = client.GetLargePayload(request).ResponseStream) { while (await response.MoveNext()) { meteoriteLandings.Add(response.Current); } } // return meteoriteLandings; }