Class: EventRouter::DeliveryAdapters::Sidekiq
- Defined in:
- lib/event_router/delivery_adapters/sidekiq.rb
Constant Summary collapse
- REQUIRED_OPTIONS =
%i[queue retry].freeze
Class Method Summary collapse
Class Method Details
.deliver(event) ⇒ Object
26 27 28 |
# File 'lib/event_router/delivery_adapters/sidekiq.rb', line 26 def deliver(event) Helpers::Sidekiq.process_event(event) end |
.deliver_async(event) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/event_router/delivery_adapters/sidekiq.rb', line 30 def deliver_async(event) serialized_event = EventRouter.serialize(event) = EventRouter::Helpers::Event.(event, self) Workers::SidekiqEventDeliveryWorker .set(queue: [:queue], retry: [:retry]) .perform_async(serialized_event) end |
.validate_options!(options) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/event_router/delivery_adapters/sidekiq.rb', line 18 def () = REQUIRED_OPTIONS - .compact.keys return true if .empty? raise Errors::RequiredOptionError.new(options: , adapter: self) end |