Ejemplo n.º 1
0
        public async Task <IActionResult> GetAsync()
        {
            var timeout = TimeSpan.FromSeconds(_options.Value.SampleTimeoutSeconds);
            var cancel  = new CancellationTokenSource(timeout);
            var samples = await Task.Run(() => _registry.SelectMany(x => x.GetSample()).ToImmutableDictionary(), cancel.Token);

            var json = JsonSampleSerializer.Serialize(samples);

            return(Ok(json));
        }