Exemple #1
0
        public virtual void callAsync(T args, string consumerId, CallAsyncDelegateResult <T> resultDelegate, CallAsyncDelegateTimeout <T> timeoutDelegate, int timeout)
        {
            Message <T> envelope = new Message <T>();

            envelope.Id   = (queuePath + "/call-" + callCurId++);
            envelope.Body = (args);
            MessageEnvelope argsEnv = envelope.createEnvelope();

            argsEnv.Body.MessageUserBody.QueuePath  = this.QueuePath;
            argsEnv.Body.MessageUserBody.ConsumerId = consumerId;
            IConsumer <T> consumer = null;

            lock (consumers)
            {
                if (!consumers.ContainsKey(consumerId))
                {
                    throw new Exception("Consumer with id:" + consumerId + " not found!");
                }
                else
                {
                    consumer = consumers[consumerId];
                }
            }
            if (consumer is IRemoteConsumer <T> )
            {
                ITransport consTransport = ((IRemoteConsumer <T>)consumer).NetworkTransport;
                consTransport.callAsync(argsEnv, new ProxyCallAsyncListener <T>(resultDelegate, timeoutDelegate), timeout);
            }
            else
            {
                throw new System.Exception("Call enabled only for remote consumer !");
            }
        }
Exemple #2
0
        public void callAsync(T args, ITransport forTransport, CallAsyncDelegateResult <T> resultDelegate, CallAsyncDelegateTimeout <T> timeoutDelegate, int timeout)
        {
            Message <T> envelope = new Message <T>();

            envelope.Id   = (this.sessionName + "/call-" + callCurId++);
            envelope.Body = (args);
            MessageEnvelope argsEnv = envelope.createEnvelope();

            argsEnv.Body.MessageUserBody.QueuePath  = (this.sessionName);
            argsEnv.Body.MessageUserBody.ConsumerId = (this.pointName);

            forTransport.callAsync(argsEnv, new ProxyCallAsyncListener <T>(resultDelegate, timeoutDelegate), timeout);
        }
Exemple #3
0
 public virtual void callAsync(T args, string consumerId, CallAsyncDelegateResult <T> resultDelegate, CallAsyncDelegateTimeout <T> timeoutDelegate)
 {
     callAsync(args, consumerId, resultDelegate, timeoutDelegate, 120);
 }
Exemple #4
0
 public ProxyCallAsyncListener(CallAsyncDelegateResult <T> resultDelegate, CallAsyncDelegateTimeout <T> timeoutDelegate)
 {
     this.timeoutDelegate = timeoutDelegate;
     this.resultDelegate  = resultDelegate;
 }
Exemple #5
0
 public void callAsync(T args, CallAsyncDelegateResult <T> resultDelegate, CallAsyncDelegateTimeout <T> timeoutDelegate, int timeout)
 {
     callAsync(args, this.transport, resultDelegate, timeoutDelegate, timeout);
 }
Exemple #6
0
 public void callAsync(T args, ITransport forTransport, CallAsyncDelegateResult <T> resultDelegate, CallAsyncDelegateTimeout <T> timeoutDelegate)
 {
     callAsync(args, forTransport, resultDelegate, timeoutDelegate, 120);
 }