Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
 public IActionDispatcher GetAnyWorkerDispatcher()
 {
     return(_workerPool.GetAnyWorkerDispatcher());
 }
 public IActionDispatcher GetAnyWorkerDispatcher()
 {
     return(_inner.GetAnyWorkerDispatcher());
 }
        public void Publish(Envelope <TPayload> message)
        {
            var thread = _workerPool.GetAnyWorkerDispatcher();

            thread.DispatchAction(new PublishEventThreadAction <TPayload>(_action, message));
        }