Beispiel #1
0
 static BitCoinRapidService()
 {
     threadPool = new DevelopMentor.ThreadPool(2, 10, "Bitcoin Push Pool");
     threadPool.RequestQueueLimit        = 10000;
     threadPool.PropogateCallContext     = true;
     threadPool.PropogateThreadPrincipal = true;
     threadPool.PropogateHttpContext     = true;
     threadPool.Start();
 }
        static RunMonitor()
        {
            // Issue: the first request to hit this handler boostraps the
            //        new appdomain & authentication scheme; the result of which
            //        is then used to initialize the thread pool.  This means the
            //        thread identity of the initial threads (2 in the code below)
            //        is equivalent to the thread identity used for this first request.
            //        Similarly, any dynamically added threads will inherit the
            //        identity of the thread that happens to trigger the new thread
            //        being added to the pool.
            //
            ThreadPool = new DevelopMentor.ThreadPool(2, 5, "RunMonitor Pool");

            ThreadPool.Start();
        }
Beispiel #3
0
        public void Process(DevelopMentor.ThreadPool threadPool, Message message)
        {
            if (message != null && message.Arguments != null && message.Arguments.Count > 0)
            {
                string username, password;
                ExtractAuthToken(m_context, out username, out password);

                // move to async handler
                var actionResult = WorkManager.TestWork(message, username, password);

                SetResult(actionResult);
                Complete(null, true);

                //async calll to remote
                threadPool.PostRequest(new DevelopMentor.WorkRequestDelegate(ProcessSubmitWorkRequest), message);
            }
            else
            {
                //async calll to remote
                threadPool.PostRequest(new DevelopMentor.WorkRequestDelegate(ProcessGetWorkRequest), message);
            }
        }