Class: RubyRabbitmqJanus::Binary

Inherits:
Object
  • Object
show all
Defined in:
lib/rrj/binary.rb

Overview

# RubyRabbitmqJanus Bynary

Initialize tools for a standalone executable This class start all tool mandatory for survey new message about JanusInstance change state.

When status enable change update document in database if enable become true a new session with janus is created

Instance Method Summary collapse

Constructor Details

#initializeBinary

Returns a new instance of Binary.



20
21
22
# File 'lib/rrj/binary.rb', line 20

def initialize
  start_instances
end

Instance Method Details

#update_instance(data) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/rrj/binary.rb', line 24

def update_instance(data)
  enable = data['enable']
  @ji = RubyRabbitmqJanus::Models::JanusInstance.find(data['id'])

  ::Log.info 'Update Janus Instance ...'
  enable ? start_instance : stop_instance
end