Sha256: b064d36ea7685a02cd23983bc8f34ab3fb0544b7a9e1487ef50867c4074d90e6

Contents?: true

Size: 1.56 KB

Versions: 28

Compression:

Stored size: 1.56 KB

Contents

# frozen_string_literal: true

# :reek:UtilityFunction

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

  # # RubyRabbitmqJanus - RRJTaskAdmin
  #
  # Used wit sidekiq/console/CI execution for admin queue in Janus gateway
  class RRJTaskAdmin < RRJTask
    # Create a transaction between apps and Janus
    #
    # @deprecated Use {#admin_endpoint} instead.
    def start_transaction_admin(options = {})
      transaction = Janus::Transactions::Admin.new(options)
      transaction.connect { yield(transaction) }
    rescue
      raise Errors::RRJAdmin::StartTransactionAdmin, options
    end

    # Create a transaction between Apps and Janus
    #
    # This transaction is sending to admin/monitor API.
    #
    # @params [Hash] options
    # @options [String] :instance (mandatory id cluster is enabled)
    # @options [Integer] :session_id
    # @options [Hash] :replace
    # @options [Hash] :add
    #
    # @example List sessions
    #   options = { 'instance' => 42 }
    #   @rrj.handle_endpoint_private(options) do |transaction|
    #     transaction.publish_message('admin::list_sessions', options)
    #   end
    #
    #
    # @example List handles
    #   options = { 'instance' => 42, 'session_id' => 71984735765 }
    #   @rrj.handle_endpoint_private(options) do |transaction|
    #     transaction.publish_message('admin::list_handles', 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

28 entries across 28 versions & 1 rubygems

Version Path
ruby_rabbitmq_janus-2.7.2 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.322 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.320 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.319 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.318 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.317 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.316 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.315 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.314 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.312 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.310 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.309 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.308 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.307 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.306 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.305 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.302 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.297 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.296 lib/rrj/task_admin.rb
ruby_rabbitmq_janus-2.7.2.pre.286 lib/rrj/task_admin.rb