private Worker(string name, Queue queue, int tooManyErrors = 10, int tooManyErrorsRetrySeconds = 30) { this.Name = name; this.Queue = queue; this.TooManyErrors = tooManyErrors; this.TooManyErrorsRetrySeconds = tooManyErrorsRetrySeconds; }
private Worker(string name, Queue queue, int tooManyErrors = 10, int tooManyErrorsRetrySeconds = 30) { if (_Instances.ContainsKey(name)) { throw new Exception("Worker name already exists: " + name); } this.Name = name; this.Queue = queue; this.TooManyErrors = tooManyErrors; this.TooManyErrorsRetrySeconds = tooManyErrorsRetrySeconds; _Instances[Name] = this; }