Sha256: 2d3b09ac00f795dd38baeabb7f99442ce2d0dd35fae99d9cafe27c9b203ee9f3

Contents?: true

Size: 1009 Bytes

Versions: 9

Compression:

Stored size: 1009 Bytes

Contents

# frozen_string_literal: true

module RubyRabbitmqJanus
  module Rabbit
    module Publisher
      # @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
      # This publisher send and read an message in admin queues
      class PublisherAdmin < Publisher
        # Intialize an queue non eclusive for admin/monitor API with Janus
        #
        # @param [String] exchange Exchange used for the transaction
        def initialize(exchange)
          @reply = exchange.queue(Tools::Config.instance.queue_admin_from)
          super(exchange)
          subscribe_to_queue
        end

        # Send an message to queue and waiting a response
        #
        # @param [String] request JSON request sending to rabbitmq queue
        #
        # @return [Janus::Response::Standard] response for an request reading
        #   by janus instance
        def publish(request)
          super(request)
          return_response
        end

        private

        attr_reader :reply
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ruby_rabbitmq_janus-2.0.0.pre.108 lib/rrj/rabbit/publish/admin.rb
ruby_rabbitmq_janus-2.0.0 lib/rrj/rabbit/publish/admin.rb
ruby_rabbitmq_janus-2.0.0.pre.106 lib/rrj/rabbit/publish/admin.rb
ruby_rabbitmq_janus-2.0.0.pre.101 lib/rrj/rabbit/publish/admin.rb
ruby_rabbitmq_janus-2.0.0.pre.100 lib/rrj/rabbit/publish/admin.rb
ruby_rabbitmq_janus-2.0.0.pre.97 lib/rrj/rabbit/publish/admin.rb
ruby_rabbitmq_janus-2.0.0.pre.96 lib/rrj/rabbit/publish/admin.rb
ruby_rabbitmq_janus-2.0.0.pre.95 lib/rrj/rabbit/publish/admin.rb
ruby_rabbitmq_janus-2.0.0.pre.42 lib/rrj/rabbit/publish/admin.rb