Esempio n. 1
0
        /// <summary>
        /// Perform the actual call.
        /// </summary>
        protected TType DoCall <TType>(ComponentId receiverId, TimeSpan?requestConfirmTimeout,
                                       TimeSpan?timeout, AsyncCallResultDelegate asyncResultDelegate, object asyncResultState,
                                       TimeSpan?asyncResultTimeout, SuperPoolProxyCall.ModeEnum callMode, CallOutcome outcome)
            where TType : class
        {
            Matrix.Framework.SuperPool.Core.SuperPool pool = _superPool;
            if (pool == null)
            {
                return(null);
            }

            SuperPoolProxyCall proxyCall;
            TType result;

            if (pool.Call <TType>(this, receiverId, out result, out proxyCall) == false)
            {
                // Call failed.
                return(null);
            }

            proxyCall.AsyncResultDelegate = asyncResultDelegate;
            proxyCall.AsyncResultState    = asyncResultState;
            proxyCall.AsyncResultTimeout  = asyncResultTimeout;

            proxyCall.RequestConfirmTimeout = requestConfirmTimeout;
            proxyCall.Timeout = timeout;

            proxyCall.Mode    = callMode;
            proxyCall.Outcome = outcome;

            return(result);
        }
Esempio n. 2
0
        protected TType DoCall <TType>(ComponentId receiverId, TimeSpan?requestConfirmTimeout, TimeSpan?timeout, AsyncCallResultDelegate asyncResultDelegate, object asyncResultState, TimeSpan?asyncResultTimeout, SuperPoolProxyCall.ModeEnum callMode, CallOutcome outcome) where TType : class
        {
            SuperPool superPool = this._superPool;

            if (superPool == null)
            {
                return(default(TType));
            }
            TType result;
            SuperPoolProxyCall call;

            if (!superPool.Call <TType>(this, receiverId, out result, out call))
            {
                return(default(TType));
            }
            call.AsyncResultDelegate   = asyncResultDelegate;
            call.AsyncResultState      = asyncResultState;
            call.AsyncResultTimeout    = asyncResultTimeout;
            call.RequestConfirmTimeout = requestConfirmTimeout;
            call.Timeout = timeout;
            call.Mode    = callMode;
            call.Outcome = outcome;
            return(result);
        }