influxdb-client-csharp icon indicating copy to clipboard operation
influxdb-client-csharp copied to clipboard

Streaming IAsyncEnumerable<FluxRecord> and IAsyncEnumerable<string>

Open adambajguz opened this issue 2 years ago • 1 comments

Proposal/Current behavior: Current IQueryApi doesn't allow for streaming raw results, i.e., results of type FluxRecord or string.

Desired behavior:

IAsyncEnumerable<T> QueryAsyncEnumerable<T>(string query, string org = null, CancellationToken cancellationToken = default(CancellationToken));

IAsyncEnumerable<T> QueryAsyncEnumerable<T>(Query query, string org = null, CancellationToken cancellationToken = default(CancellationToken));

When T is string or FluxRecord don't map the result to POCO.

Alternatives considered: Add new methods that return IAsyncEnumerable<string> and IAsyncEnumerable<FluxRecord>.

Use case: Current methods with delegates are not flexible enought (e.g. callbacks cannot use async code). Also its not always desired to map to POCO from performance reasons.

adambajguz avatar Jan 11 '23 20:01 adambajguz