public virtual IMessageCtrl AsyncProcessMessage(IMessage reqMsg, IMessageSink replySink)
 {
     ADAsyncWorkItem item = new ADAsyncWorkItem(reqMsg, this, replySink);
     WaitCallback callBack = new WaitCallback(item.FinishAsyncWork);
     ThreadPool.QueueUserWorkItem(callBack);
     return null;
 }
Example #2
0
        public virtual IMessageCtrl AsyncProcessMessage(IMessage reqMsg, IMessageSink replySink)
        {
            ADAsyncWorkItem @object  = new ADAsyncWorkItem(reqMsg, this, replySink);
            WaitCallback    callBack = new WaitCallback(@object.FinishAsyncWork);

            ThreadPool.QueueUserWorkItem(callBack);
            return(null);
        }
        [System.Security.SecurityCritical]  // auto-generated
        public virtual IMessageCtrl AsyncProcessMessage(IMessage reqMsg, IMessageSink replySink)
        {
            // This is the case where we take care of returning the calling
            // thread asap by using the ThreadPool for completing the call.

            // we use a more elaborate WorkItem and delegate the work to the thread pool
            ADAsyncWorkItem workItem = new ADAsyncWorkItem(reqMsg,
                                                           (IMessageSink)this, /* nextSink */
                                                           replySink);

            WaitCallback threadFunc = new WaitCallback(workItem.FinishAsyncWork);

            ThreadPool.QueueUserWorkItem(threadFunc);

            return(null);
        }
        [System.Security.SecurityCritical]  // auto-generated
        public virtual IMessageCtrl AsyncProcessMessage(IMessage reqMsg, IMessageSink replySink) 
        {
            // This is the case where we take care of returning the calling
            // thread asap by using the ThreadPool for completing the call.
            
            // we use a more elaborate WorkItem and delegate the work to the thread pool
            ADAsyncWorkItem workItem = new ADAsyncWorkItem(reqMsg, 
                                        (IMessageSink)this, /* nextSink */
                                        replySink);

            WaitCallback threadFunc = new WaitCallback(workItem.FinishAsyncWork);
            ThreadPool.QueueUserWorkItem(threadFunc);
            
            return null;
        }