Class: SidekiqPublisher::Runner
- Inherits:
-
Object
- Object
- SidekiqPublisher::Runner
- Defined in:
- lib/sidekiq_publisher/runner.rb
Constant Summary collapse
- LISTENER_TIMEOUT_SECONDS =
60
- CHANNEL_NAME =
"sidekiq_publisher_job"
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
Class Method Details
.run ⇒ Object
10 11 12 |
# File 'lib/sidekiq_publisher/runner.rb', line 10 def self.run new.run end |
Instance Method Details
#run ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/sidekiq_publisher/runner.rb', line 18 def run ActiveRecord::PostgresPubSub::Listener.listen( CHANNEL_NAME, listen_timeout: LISTENER_TIMEOUT_SECONDS ) do |listener| listener.on_start { publisher.publish } listener.on_notify { publisher.publish } listener.on_timeout { listener_timeout } end end |