Repository is archived
No commit activity in last 3 years
No release in over 3 years
An ActiveFedora mixin that allows a datastream dissemination response to be streamed back in blocks without reading all content into memory.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

= 0.10.5
>= 0
>= 2.9.0
>= 0

Runtime

 Project Readme

An ActiveFedora mixin that allows a datastream dissemination response to be streamed back in blocks without reading all content into memory.

Include the mixin in your ActiveFedora::Datastream subclass:

class BigData < ActiveFedora::Datastream
  include ActiveFedora::Streamable::Datastreams
end
class DataContainer < ActiveFedora::Base
  has_file_datastream :name=>'bigData', :type=> BigData
end

and then set the response_body in your controller:

DataContainer.find('demo:1').bigData.stream(self)

The iterator returned from #stream will write the bytes of a datastream dissemination back to the client in segments, without reading all of the content into memory first. It will not assign the output of the datastream dissemination to the ActiveFedora::Datastream’s content attribute.