Module: Shikibu::Notify

Defined in:
lib/shikibu/notify/notify_base.rb,
lib/shikibu/notify/pg_notify.rb,
lib/shikibu/notify/wake_event.rb

Overview

PostgreSQL LISTEN/NOTIFY support for event-driven notifications.

Defined Under Namespace

Modules: Channel Classes: NoopNotifyListener, NotifyListener, PostgresNotifyListener, WakeEvent

Class Method Summary collapse

Class Method Details

.create_listener(database_url) ⇒ NotifyListener

Factory method to create appropriate listener based on database URL



57
58
59
60
61
62
63
64
# File 'lib/shikibu/notify/notify_base.rb', line 57

def create_listener(database_url)
  if database_url&.start_with?('postgres')
    require_relative 'pg_notify'
    PostgresNotifyListener.new(database_url)
  else
    NoopNotifyListener.new
  end
end