Class: Qiniu::RS::UP::ChunkProgressNotifier

Inherits:
AbstractClass::ChunkProgressNotifier
  • Object
show all
Defined in:
lib/qiniu/rs/up.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ ChunkProgressNotifier

Returns a new instance of ChunkProgressNotifier.



36
37
38
# File 'lib/qiniu/rs/up.rb', line 36

def initialize(id)
    @tmpdata = UP::TmpData.new(id, PROGRESS_TMP_FILE)
end

Instance Attribute Details

#tmpdataObject (readonly)

Returns the value of attribute tmpdata.



35
36
37
# File 'lib/qiniu/rs/up.rb', line 35

def tmpdata
  @tmpdata
end

Instance Method Details

#notify(index, progress) ⇒ Object



39
40
41
42
43
# File 'lib/qiniu/rs/up.rb', line 39

def notify(index, progress)
    @tmpdata.set(index, progress)
    logmsg = "chunk #{progress[:offset]/Config.settings[:chunk_size]} in block #{index} successfully uploaded.\n" + progress.to_s
    Utils.debug(logmsg)
end