Class: EventMachine::Zipper::Base
- Inherits:
-
Object
- Object
- EventMachine::Zipper::Base
- Includes:
- Deferrable
- Defined in:
- lib/em-zipper/base.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#fqueue ⇒ Object
readonly
Returns the value of attribute fqueue.
-
#zos ⇒ Object
readonly
Returns the value of attribute zos.
Instance Method Summary collapse
-
#initialize(files, zos) ⇒ Base
constructor
A new instance of Base.
- #zip! ⇒ Object
Constructor Details
#initialize(files, zos) ⇒ Base
Returns a new instance of Base.
10 11 12 13 14 15 |
# File 'lib/em-zipper/base.rb', line 10 def initialize(files, zos) @files = files @zos = zos @fqueue = EM::Queue.new @count = 0 end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
8 9 10 |
# File 'lib/em-zipper/base.rb', line 8 def files @files end |
#fqueue ⇒ Object (readonly)
Returns the value of attribute fqueue.
8 9 10 |
# File 'lib/em-zipper/base.rb', line 8 def fqueue @fqueue end |
#zos ⇒ Object (readonly)
Returns the value of attribute zos.
8 9 10 |
# File 'lib/em-zipper/base.rb', line 8 def zos @zos end |
Instance Method Details
#zip! ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/em-zipper/base.rb', line 17 def zip! files.each do |file_path| EM.next_tick { chunk_data(file_path) } end fqueue.pop(&write_entry) # begin queue, first file to chunk will be issued this call self # ...new(..., ...).zip! end |