Class: ContentServer::Stream
- Inherits:
-
Object
- Object
- ContentServer::Stream
- Defined in:
- lib/content_server/file_streamer.rb
Instance Attribute Summary collapse
-
#checksum ⇒ Object
readonly
Returns the value of attribute checksum.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#tmp_path ⇒ Object
readonly
Returns the value of attribute tmp_path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(checksum, path, file, size) ⇒ Stream
constructor
A new instance of Stream.
Constructor Details
#initialize(checksum, path, file, size) ⇒ Stream
Returns a new instance of Stream.
18 19 20 21 22 23 |
# File 'lib/content_server/file_streamer.rb', line 18 def initialize(checksum, path, file, size) @checksum = checksum @path = path @file = file @size = size end |
Instance Attribute Details
#checksum ⇒ Object (readonly)
Returns the value of attribute checksum.
17 18 19 |
# File 'lib/content_server/file_streamer.rb', line 17 def checksum @checksum end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
17 18 19 |
# File 'lib/content_server/file_streamer.rb', line 17 def file @file end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
17 18 19 |
# File 'lib/content_server/file_streamer.rb', line 17 def path @path end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
17 18 19 |
# File 'lib/content_server/file_streamer.rb', line 17 def size @size end |
#tmp_path ⇒ Object (readonly)
Returns the value of attribute tmp_path.
17 18 19 |
# File 'lib/content_server/file_streamer.rb', line 17 def tmp_path @tmp_path end |
Class Method Details
.close_delete_stream(checksum, streams_hash) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/content_server/file_streamer.rb', line 25 def self.close_delete_stream(checksum, streams_hash) if streams_hash.key?(checksum) Log.debug1("close_delete_stream %s", streams_hash[checksum].path) begin streams_hash[checksum].file.close() rescue IOError => e Log.warning("While closing stream, could not close file #{streams_hash[checksum].path}." \ " IOError msg:#{e.to_s}") end streams_hash.delete(checksum) $process_vars.set('Streams size', streams_hash.size) end end |