public void Execute() { try { var response = _func.Invoke(_envelope); _request.SetResponse(response); } catch (Exception e) { _request.SetError(e); } }
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); }
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); }