Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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;
        }