Пример #1
0
        private Task ProcessResponse(TrackingDictionary state, object result, HubRequest request, Exception error)
        {
            var    exception    = error.Unwrap();
            string stackTrace   = (exception != null && _isDebuggingEnabled) ? exception.StackTrace : null;
            string errorMessage = exception != null ? exception.Message : null;

            if (exception != null)
            {
                _hubInvocationErrorsTotalCounter.SafeIncrement();
                _hubInvocationErrorsPerSecCounter.SafeIncrement();
                _allErrorsTotalCounter.SafeIncrement();
                _allErrorsPerSecCounter.SafeIncrement();
            }

            var hubResult = new HubResponse
            {
                State      = state.GetChanges(),
                Result     = result,
                Id         = request.Id,
                Error      = errorMessage,
                StackTrace = stackTrace
            };

            return(_transport.Send(hubResult));
        }
Пример #2
0
 protected override object GetInvocationData(string method, object[] args)
 {
     return(new
     {
         Hub = _hubName,
         Method = method,
         Args = args,
         State = _state.GetChanges()
     });
 }
Пример #3
0
 protected override ClientHubInvocation GetInvocationData(string method, object[] args)
 {
     return(new ClientHubInvocation
     {
         Hub = _hubName,
         Method = method,
         Args = args,
         Target = _signal,
         State = _state.GetChanges()
     });
 }
Пример #4
0
        private void ProcessResult(TrackingDictionary state, object result, HubRequest request, Exception error)
        {
            var hubResult = new HubResult
            {
                State  = state.GetChanges(),
                Result = result,
                Id     = request.Id,
                Error  = error != null?error.GetBaseException().Message : null
            };

            Send(hubResult);
        }
Пример #5
0
        private Task InvokeWithState(string method, object[] args)
        {
            string signal = _hubName + "." + _signal;

            var invocation = new
            {
                Hub    = _hubName,
                Method = method,
                Args   = args,
                State  = _state.GetChanges()
            };

            return(_connection.Broadcast(signal, invocation));
        }
Пример #6
0
        private Task ProcessResponse(TrackingDictionary state, object result, HubRequest request, Exception error)
        {
            var    exception    = error.Unwrap();
            string stackTrace   = (exception != null && _isDebuggingEnabled) ? exception.StackTrace : null;
            string errorMessage = exception != null ? exception.Message : null;

            var hubResult = new HubResponse
            {
                State      = state.GetChanges(),
                Result     = result,
                Id         = request.Id,
                Error      = errorMessage,
                StackTrace = stackTrace
            };

            return(_transport.Send(hubResult));
        }
Пример #7
0
        private Task ProcessResult(TrackingDictionary state, object result, HubRequest request, Exception error)
        {
            var hubResult = new HubResult
            {
                State = state.GetChanges(),
                Result = result,
                Id = request.Id,
                Error = error != null ? error.GetBaseException().Message : null
            };

            return Send(hubResult);
        }