1 # -*- encoding: binary -*-
5 # MogileFS::Util::StoreContent allows you to roll your own method
6 # of streaming data on an upload (instead of using a string or file)
8 # Current versions of this library support streaming a IO or IO-like
9 # object to using MogileFS::MogileFS#store_file, so using StoreContent
10 # may no longer be necessary.
11 class StoreContent < Proc
12 def initialize(total_size, &writer_proc)
13 @total_size = total_size
24 # Timeout error class. Subclassing it from Timeout::Error is the only
25 # reason we require the 'timeout' module, otherwise that module is
26 # broken and worthless to us.
27 class MogileFS::Timeout < Timeout::Error; end