Esempio n. 1
0
        int StartThread(long dueAt)
        {
            var threadNumber = threadCounter;
            var newThread    = new ProcessingThread(rampUpControllerFactory(RampUp), TryDequeue, _ => processedMessages++, s => AddEvent(threadNumber, s));
            var running      = new RunningThread(threadNumber, newThread.ReceiveLoop().GetEnumerator(), OnTheadDied, dueAt);

            threads.Add(running);
            threadCounter++;
            return(threadNumber);
        }
 int StartThread(long dueAt)
 {
     var threadNumber = threadCounter;
     var newThread = new ProcessingThread(rampUpControllerFactory(RampUp), TryDequeue, _ => processedMessages++, s => AddEvent(threadNumber, s));
     var running = new RunningThread(threadNumber, newThread.ReceiveLoop().GetEnumerator(), OnTheadDied, dueAt);
     threads.Add(running);
     threadCounter++;
     return threadNumber;
 }