lib/tracksperanto/buffer_io.rb in tracksperanto-2.1.1 vs lib/tracksperanto/buffer_io.rb in tracksperanto-2.2.0
- old
+ new
@@ -1,8 +1,9 @@
require "tempfile"
-# BufferIO is used for writing big segments of text. When the segment is bigger than a certain number of bytes,
-# the underlying memory buffer will be swapped with a tempfile
+# BufferIO is used for writing big segments of text. It works like a StringIO, but when the size
+# of the underlying string buffer exceeds MAX_IN_MEM_BYTES the string will be flushed to disk
+# and it automagically becomes a Tempfile
class Tracksperanto::BufferIO < DelegateClass(IO)
include Tracksperanto::Returning
MAX_IN_MEM_BYTES = 5_000_000
\ No newline at end of file