Example #1
0
        /// <summary>
        /// Enqueue a target and Fast Invoke delegate instance for execution.
        /// *IMPORTANT* make sure to store the delegateInstance and reuse it over multiple calls!
        /// </summary>
        public void QueueFastDelegate(object target, bool poolAsFirstParameter, FastInvokeHelper.FastInvokeHandlerDelegate delegateInstance, 
                                      params object[] args)
        {
            ThreadPoolFastEx.TargetInfo targetInfo = new ThreadPoolFastEx.TargetInfo(string.Empty,
                                                                                     target, delegateInstance, poolAsFirstParameter, this, args);

            QueueTargetInfo(targetInfo);
        }
Example #2
0
            /// <summary>
            /// Constructor.
            /// </summary>
            public TargetInfo(string invokerName, object target, FastInvokeHelper.FastInvokeHandlerDelegate delegateInstance,
                              bool poolAsFirstParameter, ThreadPoolFast pool, params object[] args)
            {
                DelegateInstance = delegateInstance;
                Target = target;
                InvokerName = invokerName;

                if (poolAsFirstParameter)
                {
                    Args = new object[] { pool, args };
                }
                else
                {
                    Args = args;
                }

                //if (args != null && args.Length == 1)
                //{// Single parameter pass.
                //    Args = new object[] { pool, args[0] };
                //}
                //else
                //{
                //    Args = new object[] { pool, args };
                //}
            }
Example #3
0
 /// <summary>
 /// Enqueue a target and Fast Invoke delegate instance for execution.
 /// *IMPORTANT* make sure to store the delegateInstance and reuse it over multiple calls!
 /// </summary>
 public void QueueFastDelegate(object target, FastInvokeHelper.FastInvokeHandlerDelegate delegateInstance,
                               params object[] args)
 {
     QueueFastDelegate(target, false, delegateInstance, args);
 }