Sha256: 7cf3f658e42ab0f2a2199e0faa7dd4ce77675a8ceb11eec185cda815b84133cb
Contents?: true
Size: 818 Bytes
Versions: 13
Compression:
Stored size: 818 Bytes
Contents
begin require 'sidekiq' rescue LoadError end module Pwwka class SendMessageAsyncSidekiqJob begin include Sidekiq::Worker extend Pwwka::Logging sidekiq_options queue: 'pwwka_send_message_async', retry: 3 def perform(payload, routing_key, options = {}) type = options["type"] message_id = options["message_id"] || "auto_generate" headers = options["headers"] logger.info("Sending message async #{routing_key}, #{payload}") message_id = message_id.to_sym if message_id == "auto_generate" Pwwka::Transmitter.send_message!( payload, routing_key, type: type, message_id: message_id, headers: headers, on_error: :raise, ) end rescue NameError end end end
Version data entries
13 entries across 13 versions & 1 rubygems