コード例 #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);
        }
コード例 #2
0
        /// <summary>
        /// Perform the actual call.
        /// </summary>
        /// <param name="receivers">The list of recipients ids.</param>
        /// <param name="timeOut">The time out for sync calls, or null for async.</param>
        protected TType DoCallMany <TType>(IEnumerable <ComponentId> receivers, TimeSpan?timeOut)
            where TType : class
        {
            Matrix.Framework.SuperPool.Core.SuperPool pool = _superPool;
            if (pool == null)
            {
                return(null);
            }

            SuperPoolProxyCall call;
            TType result;

            if (pool.Call <TType>(this, receivers, out result, out call))
            {
                call.Timeout = timeOut;
                return(result);
            }

            // Call failed.
            return(null);
        }