lib/async/http/body/writable.rb in async-http-0.19.0 vs lib/async/http/body/writable.rb in async-http-0.20.0
- old
+ new
@@ -49,10 +49,11 @@
end
return chunk
end
+ # Cause the next call to write to fail with the given error.
def stop(error)
@stopped = error
end
# Write a single chunk to the body. Signal completion by calling `#finish`.
@@ -65,16 +66,18 @@
@count += 1
@queue.enqueue(chunk)
end
+ alias << write
+
# Signal that output has finished.
def finish
@queue.enqueue(nil)
end
def inspect
- "\#<#{self.class} #{@count} chunks written>"
+ "\#<#{self.class} #{@count} chunks written#{@finished ? ', finished' : ''}>"
end
end
end
end
end