Lines Matching refs:ConcurrencyBalancer
3 describe ConcurrencyBalancer do
5 let(:balancer) { ConcurrencyBalancer.new }
6 let(:redis) { ConcurrencyBalancer::RedisWrapper.new }
9 redis.del ConcurrencyBalancer::REDIS_KEY
10 redis.del ConcurrencyBalancer::SEQUENTIAL_LOCK_KEY
22 redis.sadd ConcurrencyBalancer::REDIS_KEY, 'iri'
24 to raise_error(ConcurrencyBalancer::AlreadyProcessingError)
30 redis.sadd ConcurrencyBalancer::REDIS_KEY, 'iri'
39 to raise_error(ConcurrencyBalancer::UnmarkedProcessingError)
45 redis.sadd ConcurrencyBalancer::REDIS_KEY, 'iri'
53 redis.sadd ConcurrencyBalancer::REDIS_KEY, 'iri'
59 redis.sadd ConcurrencyBalancer::REDIS_KEY, 'iri'
61 expect(redis.sismember ConcurrencyBalancer::REDIS_KEY, 'iri').
74 expect(redis.sismember ConcurrencyBalancer::REDIS_KEY, 'iri').
81 redis.sadd(ConcurrencyBalancer::SEQUENTIAL_LOCK_KEY, true)
82 expect { ConcurrencyBalancer.sequential_lock(&:+) }.
83 to raise_error(ConcurrencyBalancer::AlreadyLockedError)
87 expect { ConcurrencyBalancer.sequential_lock { } }.
92 expect { ConcurrencyBalancer.sequential_lock { raise ArgumentError } }.
97 expect { ConcurrencyBalancer.sequential_lock { raise ArgumentError } }.
99 expect(redis.sismember ConcurrencyBalancer::REDIS_KEY, 'iri').to be(false)