예제 #1
0
 public void Execute()
 {
     try
     {
         var response = _func.Invoke(_envelope);
         _request.SetResponse(response);
     }
     catch (Exception e)
     {
         _request.SetError(e);
     }
 }
예제 #2
0
        public void Request(Envelope <TRequest> envelope, IResponseReceiver <TResponse> request)
        {
            var thread = _workerPool.GetAnyWorkerDispatcher();

            if (thread == null)
            {
                var response = _func.Invoke(envelope);
                request.SetResponse(response);
                return;
            }

            var responseWaiter = new DispatchableRequest <TRequest, TResponse>(_func, envelope, Id, request);

            thread.DispatchAction(responseWaiter);
        }
예제 #3
0
        public void Request(Envelope <TRequest> envelope, IResponseReceiver <TResponse> request)
        {
            var value = _func.Invoke(envelope);

            request.SetResponse(value);
        }
 public void SetResponse(TResponse response)
 {
     _circuitBreaker.RecordResult(true);
     _inner.SetResponse(response);
 }