Beispiel #1
0
 public ShutdownGuardTests()
 {
     this.thread1 = new Thread(SeparatedThread);
     this.thread2 = new Thread(SeparatedThread);
     this.thread3 = new Thread(SeparatedThread);
     this.thread4 = new Thread(SeparatedThread);
     this.subject = new ShutdownGuard();
 }
Beispiel #2
0
 public EventPublisher(IOptions <EventBusOptions> options, IConnection connection, ILogger <EventPublisher> logger)
     : base(options, connection)
 {
     this.logger        = logger;
     this.channels      = new SortedDictionary <DateTime, IModel>(Comparer <DateTime> .Create((l, r) => r.CompareTo(l)));
     this.pendings      = new SortedSet <PendingMessage>();
     this.shutdownGuard = new ShutdownGuard();
 }
Beispiel #3
0
        public ShutdownGuardTests()
        {
            this.ready   = new List <TaskCompletionSource <bool> >();
            this.threads = new List <Thread>();

            for (var i = 0; i < Environment.ProcessorCount; i++)
            {
                this.ready.Add(new TaskCompletionSource <bool>());
                this.threads.Add(new Thread(this.SeparatedThread));
            }

            this.subject = new ShutdownGuard();
        }