コード例 #1
0
        public override async Task <string> RunResultAsRawJson(ReqlAst term, object globalOpts, CancellationToken cancelToken)
        {
            HostEntry host = GetRoundRobin();

            try {
                return(await host.conn.RunResultAsRawJson(term, globalOpts, cancelToken).ConfigureAwait(false));
            }
            catch (Exception e) when(ExceptionIs.NetworkError(e))
            {
                host.MarkFailed();
                throw;
            }
        }
コード例 #2
0
        public override void RunNoReply(ReqlAst term, object globalOpts)
        {
            HostEntry host = GetRoundRobin();

            try
            {
                host.conn.RunNoReply(term, globalOpts);
            }
            catch (Exception e) when(ExceptionIs.NetworkError(e))
            {
                host.MarkFailed();
                throw;
            }
        }
コード例 #3
0
        public override void RunNoReply(ReqlAst term, object globalOpts)
        {
            HostEntry host = GetEpsilonGreedy();

            try
            {
                var start = DateTime.Now.Ticks;
                host.conn.RunNoReply(term, globalOpts);
                var end = DateTime.Now.Ticks;
                MarkSuccess(host, start, end);
            }
            catch (Exception e) when(ExceptionIs.NetworkError(e))
            {
                host.MarkFailed();
                throw;
            }
        }
コード例 #4
0
        public override async Task <Cursor <T> > RunCursorAsync <T>(ReqlAst term, object globalOpts, CancellationToken cancelToken)
        {
            HostEntry host = GetEpsilonGreedy();

            try
            {
                var start  = DateTime.Now.Ticks;
                var result = await host.conn.RunCursorAsync <T>(term, globalOpts, cancelToken).ConfigureAwait(false);

                var end = DateTime.Now.Ticks;
                MarkSuccess(host, start, end);
                return(result);
            }
            catch (Exception e) when(ExceptionIs.NetworkError(e))
            {
                host.MarkFailed();
                throw;
            }
        }