Module: SolidObjects::WakeUpAdapters

Defined in:
lib/solid_objects/wake_up_adapters.rb,
lib/solid_objects/wake_up_adapters/redis.rb,
lib/solid_objects/wake_up_adapters/postgresql.rb,
sig/generated/lib/solid_objects/wake_up_adapters.rbs,
sig/generated/lib/solid_objects/wake_up_adapters/redis.rbs,
sig/generated/lib/solid_objects/wake_up_adapters/postgresql.rbs

Defined Under Namespace

Classes: Postgresql, Redis

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.for(connection = Record.connection) ⇒ Object

Returns the best wake-up strategy for a connection: cross-process notifications where the database provides them, and the in-process default everywhere else.

This is deliberately not the default. A notification adapter opens a connection per waiting thread outside the pool, and LISTEN does not survive a transaction-pooling proxy such as PgBouncer, so adopting it is a deployment decision rather than an upgrade side effect.

RBS:

  • (?untyped) -> untyped



17
18
19
20
21
# File 'lib/solid_objects/wake_up_adapters.rb', line 17

def for(connection = Record.connection)
  return Postgresql.new if DatabaseAdapter.family(connection) == :postgresql

  WakeUp.new
end

Instance Method Details

#self?.forObject

Returns the best wake-up strategy for a connection: cross-process notifications where the database provides them, and the in-process default everywhere else.

This is deliberately not the default. A notification adapter opens a connection per waiting thread outside the pool, and LISTEN does not survive a transaction-pooling proxy such as PgBouncer, so adopting it is a deployment decision rather than an upgrade side effect.

RBS:

  • (?untyped) -> untyped

Parameters:

  • (Object)

Returns:

  • (Object)


15
# File 'sig/generated/lib/solid_objects/wake_up_adapters.rbs', line 15

def self?.for: (?untyped) -> untyped