You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
publicstaticclassQueryApiExtensions{publicstaticIAsyncEnumerable<FluxRecord>QueryAsyncEnumerable(thisQueryApiqueryApi,Queryquery,string?org=null,CancellationTokencancellationToken=default){//Set up these options to be sure to not keep all previous data in the Channel. This might takes a lot of RAM.//The channel will only one record at a time.//The channel will recieve the next FluxRecord when a reader has read the previous one (and only one). varoptions=newBoundedChannelOptions(1){SingleWriter=true,SingleReader=true,FullMode=BoundedChannelFullMode.Wait};varbuffer=Channel.CreateBounded<FluxRecord>(options);queryApi.QueryAsync(query,onNext:async(record)=>awaitbuffer.Writer.WriteAsync(record),onComplete:()=>buffer.Writer.Complete(),onError:(e)=>buffer.Writer.Complete(e),org:org,cancellationToken:cancellationToken);returnbuffer.Reader.ReadAllAsync(cancellationToken);}}
Of course the best long-term solution will be to create a new pull request and create another QueryAsyncEnumerable function that takes not generic type, will not convert the record and send it back instead.
Proposal/Current behavior:
Current
IQueryApi
doesn't allow for streaming raw results, i.e., results of typeFluxRecord
orstring
.Desired behavior:
When
T
isstring
orFluxRecord
don't map the result to POCO.Alternatives considered:
Add new methods that return
IAsyncEnumerable<string>
andIAsyncEnumerable<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.
The text was updated successfully, but these errors were encountered: