public async Task GetPipelineData([FromBody] FetchDataRequest body) { Response.ContentType = "application/octet-stream"; var pipelines = await Task.WhenAll(body.Pipelines.Select(p => Data.Pipes.PipelineCompiler.Compile(p, _DataSources, _ResCache))); // Parse and apply X range foreach (var pipeline in pipelines) { pipeline.ApplyXRange( Helper.ParseRange( pipeline.QueryLeafXType(), body.From, body.To ) ); } using (var encoder = new Data.BinaryDataBuffer()) { // Drain the pipeline into a stream foreach (var pipeline in pipelines) { await encoder.Consume(pipeline); await encoder.FlushAsync(Response.Body); } } await Response.CompleteAsync(); }
public async Task <IActionResult> GetPipelineSpecs([FromBody] FetchDataRequest body) { return(Ok( (await Task.WhenAll(body.Pipelines.Select(p => Data.Pipes.PipelineCompiler.Compile(p, _DataSources, _ResCache)))).Select(p => p.GetSpecs()) )); }