Class: SidekiqPublisher::Runner
- Inherits:
-
Object
- Object
- SidekiqPublisher::Runner
- Extended by:
- PrivateAttr
- 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
14 15 16 |
# File 'lib/sidekiq_publisher/runner.rb', line 14 def self.run new.run end |
Instance Method Details
#run ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/sidekiq_publisher/runner.rb', line 22 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 |