示例#1
0
 public override void InitializeTest()
 {
     m_ioService      = new IoServiceScheduler();
     m_threadPool     = new IoServiceThreadPoolScheduler(m_ioService);
     m_proxyScheduler = new ProxyScheduler(m_threadPool);
     base.InitializeTest();
 }
示例#2
0
 public override void InitializeTest()
 {
     m_innerScheduler  = CreateInnerScheduler();
     m_strandScheduler = new StrandSchedulerDecorator(m_innerScheduler);
     m_proxyScheduler  = new ProxyScheduler(m_strandScheduler);
     base.InitializeTest();
 }
示例#3
0
        public ConsoleRunner()
        {
            m_scheduler = new IoServiceScheduler();
            var proxyScheduler = new ProxyScheduler(m_scheduler);

            m_synchContext = new LogSynchronizationContextDecorator(
                new IoServiceSynchronizationContext(m_scheduler, disposeIoServiceAfterComplete: true));
        }
 private StrandSchedulerDecorator getStrand(object invocationTarget)
 {
     return(m_strandActorDictionary.GetValue(invocationTarget, _ =>
     {
         var strandScheduler = new StrandSchedulerDecorator(m_primaryScheduler);
         var externalProxyScheduler = new ProxyScheduler(strandScheduler);
         return strandScheduler;
     }));
 }
示例#5
0
        public AsyncPlayerTest()
        {
            var ioServiceScheduler = new IoServiceScheduler();

            var threadPoolScheduler    = new IoServiceThreadPoolScheduler(ioServiceScheduler, 1);
            var externalProxyScheduler = new ProxyScheduler(threadPoolScheduler);

            m_proxyEngine = new ProxyEngine(threadPoolScheduler);
            createActors();
        }
示例#6
0
        private static void runSimpleUploaderActor()
        {
            const int NUMBER_OF_THREADS = 1;
            var       ioService         = new IoServiceScheduler();
            var       primaryScheduler  = new IoServiceThreadPoolScheduler(ioService, NUMBER_OF_THREADS);
            var       proxyScheduler    = new ProxyScheduler(primaryScheduler);

            var proxyEngine         = new ProxyEngine(primaryScheduler);
            var simpleUploaderActor = new SimpleUploaderActor();

            var uploaderActorProxy = proxyEngine.CreateProxy <IService>(simpleUploaderActor);

            runSimpleUploader(uploaderActorProxy);
        }
示例#7
0
        private static void runTaskunTaskOnCurrentThreadScheduler2()
        {
            const int MAX_TASKS = 100;

            Console.WriteLine("Main thread id: {0}", Thread.CurrentThread.ManagedThreadId);

            var fallBackScheduler = new FallbackScheduler2();
            var scheduler         = new CurrentThreadScheduler2(fallBackScheduler);
            var proxyScheduler    = new ProxyScheduler(scheduler);

            fallBackScheduler.ProxyScheduler = proxyScheduler;

            var taskfactory = new TaskFactory(proxyScheduler.AsTplScheduler());
            var tasks       = Enumerable.Range(0, MAX_TASKS).Select(taskId => taskfactory.StartNew(() =>
            {
                Console.WriteLine(" Task: {0} tid: {1}", taskId,
                                  Thread.CurrentThread.ManagedThreadId);
            }));

            Task.WhenAll(tasks).Wait();
        }
示例#8
0
 public override void InitializeTest()
 {
     m_scheduler      = new IoServiceScheduler();
     m_proxyScheduler = new ProxyScheduler(m_scheduler);
     base.InitializeTest();
 }
 public LogCoroutineTester()
 {
     m_scheduler      = new IoServiceScheduler();
     m_proxyScheduler = new ProxyScheduler(m_scheduler);
     m_coroutine      = new Coroutine(m_scheduler);
 }
 public override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
 {
     return(ProxyScheduler.DoTryExecuteTask(task));
 }
 public override void QueueTask(Task task)
 {
     ProxyScheduler.DoTryExecuteTask(task);
 }