Sha256: eaf461bc1131a81d2c532eb50ff8c6fc8addf5274df7696ea6ac7b2a16bbefb1

Contents?: true

Size: 823 Bytes

Versions: 6

Compression:

Stored size: 823 Bytes

Contents

require 'sidekiq'
require 'forwardable'
require 'routemaster/client/backends/sidekiq/worker'
require 'routemaster/client/backends/sidekiq/configuration'

module Routemaster
  module Client
    module Backends
      class Sidekiq
        class << self
          extend Forwardable

          attr_reader :options

          def configure
            self.tap do
              Configuration.configure do |c|
                yield c
              end
              @options = {'class' => Worker}.merge Configuration.sidekiq_options
            end
          end

          def send_event(*args)
            opts = @options.merge('args' => args)
            ::Sidekiq::Client.push opts

            # The push will throw an exception if there is a problem
            true
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
routemaster-client-3.2.3 routemaster/client/backends/sidekiq.rb
routemaster-client-3.2.0 routemaster/client/backends/sidekiq.rb
routemaster-client-3.1.2 routemaster/client/backends/sidekiq.rb
routemaster-client-3.1.1 routemaster/client/backends/sidekiq.rb
routemaster-client-3.1.0 routemaster/client/backends/sidekiq.rb
routemaster-client-3.0.0 routemaster/client/backends/sidekiq.rb