-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: GridFS
-
None
Currently gridfs open_upload_stream and open_download_stream methods return the stream when given the block. The convention in Ruby checked with e.g. File.open(...)
{ ... }is to return the result of block execution when the block is given. This ticket covers following the same convention in GridFS.
This issue is more significant in reads because the following pattern does not work currently:
actual = fs.open_download_stream(a.file_id) do |stream|
stream.read
end
`actual` receives the stream, not the data read.
This would be a 3.0 change since currently the stream provides the file_id method which is likely to be used by applications to determine the stream id. If this is needed with the change proposed in this ticket, the applications can return the stream as the block value.