Sha256: 90a60546ef6087196414153ed73bad36f4e6ba05d129473b2492a847d837fb78

Contents?: true

Size: 1.38 KB

Versions: 31

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

# :reek:UtilityFunction

module RubyRabbitmqJanus
  # @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>

  # # RubyRabbitmqJanus - RRJAdmin
  #
  # This class inherite to a classic initializer but it's used for
  # admin request sending to janus (Admin/Monitor API).
  #
  # **Is used just for sending a message to Janus Monitor/Admin API.**.
  # **The queue is always ***exclusive*** for not transmitting data to
  # anyone.**
  #
  # @see https://janus.conf.meetecho.com/docs/admin.html
  class RRJAdmin < RRJ
    # Create a transaction between Apps and Janus
    #
    # @param [Hash] options
    #   Give a session number for use another session in Janus
    #
    # @example List all sessions in Janus Instance
    #   instance = { 'instance' => 42 }
    #   @rrj.admin_endpoint(instance) do |transaction|
    #     response = transaction.publish_message('admin:sessions').sessions
    #   end
    #
    # @example Change log level to Janus Instance
    #   instance = { 'instance' => 42 }
    #   options = instance.merge({ 'level' => 5 })
    #   @rrj.admin_endpoint(options) do |transaction|
    #     response = transaction.publish_message('admin:set_log_level', options)
    #   end
    #
    # @since 2.7.0
    def admin_endpoint(options = {})
      transaction = Janus::Transactions::Admin.new(options)
      transaction.connect { yield(transaction) }
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
ruby_rabbitmq_janus-4.0.1 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.1.pre.1265973744 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.1.pre.1265506307 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.1.pre.1265140558 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0.pre.1001345090 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0.pre.1001181479 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0.pre.1001132533 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0.pre.1001107243 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0.pre.1001043172 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0.pre.949167646 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0.pre.946892338 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0.pre.946565704 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0.pre.939149205 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0.pre.939137013 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0.pre.939133437 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0.pre.939119110 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0.pre.939113634 lib/rrj/admin.rb
ruby_rabbitmq_janus-4.0.0.pre.850041590 lib/rrj/admin.rb
ruby_rabbitmq_janus-3.0.1 lib/rrj/admin.rb