Class: JanusGateway::Plugin::Audioroom
- Inherits:
-
Resource::Plugin
- Object
- Resource
- Resource::Plugin
- JanusGateway::Plugin::Audioroom
- Defined in:
- lib/janus_gateway/plugin/audioroom.rb
Instance Attribute Summary
Attributes inherited from Resource::Plugin
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(client, session) ⇒ Audioroom
constructor
A new instance of Audioroom.
- #list ⇒ Concurrent::Promise
Methods inherited from Resource::Plugin
Methods inherited from Resource
Constructor Details
#initialize(client, session) ⇒ Audioroom
Returns a new instance of Audioroom.
5 6 7 |
# File 'lib/janus_gateway/plugin/audioroom.rb', line 5 def initialize(client, session) super(client, session, 'janus.plugin.cm.audioroom') end |
Instance Method Details
#list ⇒ Concurrent::Promise
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/janus_gateway/plugin/audioroom.rb', line 10 def list promise = Concurrent::Promise.new client.send_transaction( janus: 'message', session_id: session.id, handle_id: id, body: { request: 'list' } ).then do |data| plugindata = data['plugindata']['data'] if plugindata['error_code'].nil? _on_success(data) promise.set(data).execute else error = JanusGateway::Error.new(plugindata['error_code'], plugindata['error']) _on_error(error) promise.fail(error).execute end end.rescue do |error| promise.fail(error).execute end promise end |