Ejemplo n.º 1
0
        public static async Task RunAsync()
        {
            await using var stream = JsonStreamFactory.CreateGraphQlResponseStream();

            var parser = new GraphQlResponseParser();

            var user = await parser.ParseResponseJsonAsync(stream);
        }
Ejemplo n.º 2
0
        public static async Task RunAsync()
        {
            await using var stream = JsonStreamFactory.CreateGraphQlResponseStream();

            var parser = new LowLevelGraphQlResponseParser();

            var user = parser.ParseResponseJsonWithoutPipeReader(stream);
        }
Ejemplo n.º 3
0
        public void Setup()
        {
            _midLevelParser = new GraphQlResponseParser();
            _lowLevelParser = new LowLevelGraphQlResponseParser();
            _stream         = JsonStreamFactory.CreateGraphQlResponseStream();
            _emptyStream    = JsonStreamFactory.CreateEmptyGraphQlResponseStream();

            // needed for benchmarking to avoid stream closure
            // passed in as argument since under normal use we won't need to allocate this and can allow the stream to close
            _streamPipeReaderOptions = new StreamPipeReaderOptions(leaveOpen: true);
        }