Module: Wurk::Metrics::PoolRegistry
- Defined in:
- lib/wurk/metrics/pool_registry.rb
Overview
This process's live RedisPools by name, for the /metrics pool gauges.
A pool joins when built and leaves on RedisPool#disconnect!; a later pool
with the same name replaces the earlier one.
Class Method Summary collapse
Class Method Details
.deregister(pool) ⇒ Object
17 18 19 |
# File 'lib/wurk/metrics/pool_registry.rb', line 17 def deregister(pool) @lock.synchronize { @pools.delete(pool.name) if @pools[pool.name].equal?(pool) } end |
.live ⇒ Object
21 22 23 |
# File 'lib/wurk/metrics/pool_registry.rb', line 21 def live @lock.synchronize { @pools.values } end |
.register(pool) ⇒ Object
13 14 15 |
# File 'lib/wurk/metrics/pool_registry.rb', line 13 def register(pool) @lock.synchronize { @pools[pool.name] = pool } end |