Skip to content
This repository has been archived by the owner on Jan 9, 2018. It is now read-only.

An ActiveFedora mixin that allows a datastream dissemination response to be streamed back

License

Notifications You must be signed in to change notification settings

cul/active_fedora_streamable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

An ActiveFedora mixin that allows a datastream dissemination response to be streamed back

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages