class Roda::RodaPlugins::Streaming::Stream::Scheduler

using ruby’s default threading support.
The default scheduler to used when streaming, useful for code

def defer(*)

Immediately yield.
def defer(*)
  yield
end

def initialize(stream)

Store the stream to schedule.
def initialize(stream)
  @stream = stream
end

def schedule(*)

and reraise the exception if so.
Close the stream if there is an exception when scheduling,
def schedule(*)
  yield
rescue Exception
  @stream.close
  raise
end