Class: MultiEc2Kiq::Ec2

Inherits:
Object
  • Object
show all
Defined in:
lib/threads/ec2.rb

Instance Method Summary collapse

Constructor Details

#initialize(id, region) ⇒ Ec2

Returns a new instance of Ec2.



7
8
9
10
# File 'lib/threads/ec2.rb', line 7

def initialize(id, region)
  @id = id
  @region = region
end

Instance Method Details

#startObject



12
13
14
15
16
# File 'lib/threads/ec2.rb', line 12

def start
  start_instance
  puts_started_message
  true
end

#start_wait_until_stopObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/threads/ec2.rb', line 18

def start_wait_until_stop
  start
  dynamodb.started(@id)

  if dynamodb.wait_until_to_stop(@id)
    stop_instance
    dynamodb.stopped(@id)
  end
  
  true
end