Class: Wisper::SidekiqBroadcaster
- Inherits:
-
Object
- Object
- Wisper::SidekiqBroadcaster
- Defined in:
- lib/wisper/sidekiq.rb
Overview
based on Sidekiq 4.x #delay method, which is not enabled by default in Sidekiq 5.x github.com/mperham/sidekiq/blob/4.x/lib/sidekiq/extensions/generic_proxy.rb github.com/mperham/sidekiq/blob/4.x/lib/sidekiq/extensions/class_methods.rb
Defined Under Namespace
Classes: Worker
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.register ⇒ Object
27 28 29 30 31 32 |
# File 'lib/wisper/sidekiq.rb', line 27 def self.register Wisper.configure do |config| config.broadcaster :sidekiq, SidekiqBroadcaster.new config.broadcaster :async, SidekiqBroadcaster.new end end |
Instance Method Details
#broadcast(subscriber, _publisher, event, *args, **kwargs) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/wisper/sidekiq.rb', line 34 def broadcast(subscriber, _publisher, event, *args, **kwargs) = (subscriber) = (subscriber, event) Worker.set().perform_in( .fetch(:delay, 0), ::YAML.dump([subscriber, event, args, kwargs]) ) end |