Example #1
0
        public async void Query(string bucket, string org)
        {
            string flux = $"from(bucket:\"{bucket}\") |> range(start: 0)";

            var queryApi = client.GetQueryApi();

            await queryApi.QueryAsync(flux, org, (cancellable, record) =>
            {
                QueryComplete?.Invoke(this, new QueryCompleteEventArgs(record));
            },
                                      exception =>
            {
                QueryException?.Invoke(this, new QueryExceptionEventArgs(exception));
            },
                                      () =>
            {
                QuerySuccess?.Invoke(this, new QuerySuccessEventArgs());
            });
        }
Example #2
0
        public void SetClosures(SDK.IQBBase qry, QuerySuccess success, QueryFailure failure = null, bool allowEmpty = false)
        {
            var rqs = _msg.RequestList;

            for (int idx = 0; idx < rqs.Count; idx++)
            {
                var rq = rqs.GetAt(idx);
                if (rq.Detail == qry)
                {
                    _clousures.Add(rq.RequestID, new ClosureSpec()
                    {
                        success          = success,
                        failure          = failure,
                        allowEmptyReturn = allowEmpty
                    });
                    return;
                }
            }

            throw new Exception("Query not found in this batch");
        }
Example #3
0
        public void SetClosures(SDK.IQBBase qry, QuerySuccess success, QueryFailure failure = null, bool allowEmpty = false)
        {
            var rqs = _msg.RequestList;

            for (int idx = 0; idx < rqs.Count; idx++)
            {
                var rq = rqs.GetAt(idx);
                if (rq.Detail == qry)
                {
                    _clousures.Add(rq.RequestID, new ClosureSpec()
                    {
                        success = success,
                        failure = failure,
                        allowEmptyReturn = allowEmpty
                    });
                    return;
                }
            }

            throw new Exception("Query not found in this batch");
        }