Class: S3Batch::TaskManager

Inherits:
Object
  • Object
show all
Defined in:
lib/s3batch/batch_upload.rb

Instance Method Summary collapse

Constructor Details

#initializeTaskManager

Returns a new instance of TaskManager.



4
5
6
7
# File 'lib/s3batch/batch_upload.rb', line 4

def initialize
  @count = 0
  @adding_ended = false
end

Instance Method Details

#addObject



9
10
11
# File 'lib/s3batch/batch_upload.rb', line 9

def add
  @count += 1
end

#end_addingObject



18
19
20
21
# File 'lib/s3batch/batch_upload.rb', line 18

def end_adding
  @adding_ended = true
  EM.stop if @count == 0
end

#removeObject



13
14
15
16
# File 'lib/s3batch/batch_upload.rb', line 13

def remove
  @count -= 1
  EM.stop if @count == 0 && @adding_ended
end