Module: Wurk::RedisConnection
- Defined in:
- lib/wurk/redis_connection.rb
Overview
Sidekiq-compatible pool constructor. Sidekiq::RedisConnection.create(...)
is the documented way to build a standalone Redis pool (spec §26) — it's the
default pool for Sidekiq::Deploy (§23) and the constructor for per-shard
pools in multi-shard web mounts (Pro §10.2). Returns a Wurk::RedisPool
(connection_pool-backed, redis-client adapter), which is .with-compatible
with everything that expects a Sidekiq pool.
Accepts Sidekiq's option keys (url, size, pool_timeout, name) plus
the socket knobs (connect_timeout/read_timeout/write_timeout/
reconnect_attempts/driver), string- or symbol-keyed. Anything omitted
falls back to RedisPool's defaults (URL = ENV or
redis://localhost:6379/0).
Constant Summary collapse
- DEFAULT_POOL_SIZE =
Housekeeping/standalone default; per-capsule pools size to concurrency.
10
Class Method Summary collapse
Class Method Details
.create(options = {}) ⇒ Object
22 23 24 25 |
# File 'lib/wurk/redis_connection.rb', line 22 def self.create( = {}) opts = .transform_keys(&:to_sym) RedisPool.new(size: opts.delete(:size) || DEFAULT_POOL_SIZE, **opts) end |