public IDisposable RegisterManagedThread(string owner, int threadId, string purpose)
            {
                var token = _inner.RegisterManagedThread(owner, threadId, purpose);

                _tokens.Add(token);
                return(token);
            }
Ejemplo n.º 2
0
        public OutboxMonitor(ILogger logger, IWorkerPool workers, int pollDelayMs)
        {
            Assert.ArgumentNotNull(logger, nameof(logger));
            Assert.ArgumentNotNull(workers, nameof(workers));
            Assert.IsInRange(pollDelayMs, nameof(pollDelayMs), 1000, int.MaxValue);

            _outboxes = new ConcurrentDictionary <long, IOutboxSender>();
            var strategy = new OutboxWorkerStrategy(this, pollDelayMs);

            _thread      = new IntervalWorkerThread(logger, strategy);
            _threadToken = workers.RegisterManagedThread("Outbox Module", _thread.ThreadId, "Outbox worker thread");
        }