Class | Rev::Buffer |
In: |
ext/rev/rev_buffer.c
|
Parent: | Object |
High speed buffering geared towards non-blocking I/O. This was largely written in response to String#slice! being incredibly slow in Ruby 1.9.
Data is stored in a byte queue implemented as a linked list of equal size chunks. Since every node in the list is the same size they are easily memory pooled. Routines are provided for high speed non-blocking reads and writes from Ruby IO objects.
Read the specified abount of data from the buffer. If no value is given the entire contents of the buffer are returned. Any data read from the buffer is cleared.