Class: Pantry::Communication::FileService::UploadInfo
- Inherits:
-
Object
- Object
- Pantry::Communication::FileService::UploadInfo
- Defined in:
- lib/pantry/communication/file_service/file_progress.rb
Overview
Informational object for keeping track of file upload progress and important information.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#file_uuid ⇒ Object
The file session identity from the Receiver.
-
#receiver_uuid ⇒ Object
Identity of the Receiver we’re sending a file to.
Instance Method Summary collapse
- #finished! ⇒ Object
-
#initialize ⇒ UploadInfo
constructor
A new instance of UploadInfo.
-
#wait_for_finish(timeout = nil) ⇒ Object
Block and wait for the file upload to finish.
Constructor Details
#initialize ⇒ UploadInfo
Returns a new instance of UploadInfo.
15 16 17 |
# File 'lib/pantry/communication/file_service/file_progress.rb', line 15 def initialize @finish_future = Celluloid::Future.new end |
Instance Attribute Details
#file_uuid ⇒ Object
The file session identity from the Receiver
13 14 15 |
# File 'lib/pantry/communication/file_service/file_progress.rb', line 13 def file_uuid @file_uuid end |
#receiver_uuid ⇒ Object
Identity of the Receiver we’re sending a file to
10 11 12 |
# File 'lib/pantry/communication/file_service/file_progress.rb', line 10 def receiver_uuid @receiver_uuid end |
Instance Method Details
#finished! ⇒ Object
24 25 26 |
# File 'lib/pantry/communication/file_service/file_progress.rb', line 24 def finished! @finish_future.signal(OpenStruct.new(:value => self)) end |
#wait_for_finish(timeout = nil) ⇒ Object
Block and wait for the file upload to finish
20 21 22 |
# File 'lib/pantry/communication/file_service/file_progress.rb', line 20 def wait_for_finish(timeout = nil) @finish_future.value(timeout) end |