def chunks_fiber
      @chunks_fiber ||= Fiber.new do
        begin
          @chunks.each do |chunk|
            action = Fiber.yield chunk
            break if action == :terminate
          end
        ensure
          @on_close.call if @on_close
        end
      end
    end
def chunks_fiber
      @chunks_fiber ||= Fiber.new do
        begin
          @chunks.each do |chunk|
            action = Fiber.yield chunk
            break if action == :terminate
          end
        ensure
          @on_close.call if @on_close
        end
      end
    end
Creates a Fiber wrapper around the underlying enumerator. The advantage
 of using a Fiber here is that we can terminate the chunk retrieval, in a
 way that executes any cleanup code that the enumerator potentially
 carries. At the end of iteration the :on_close callback is executed.