class Duo::Data

Overview

Wraps a circular buffer to buffer incoming Data. The buffer capacity is the initial window size. The stream window size decreases whenever reading and a WindowUpdate frame will be sent whenever the window size falls below half the buffer size (incremented by half the buffer size).

Defined in:

duo/data.cr

Instance Method Summary

Instance Method Detail

def close : Nil #
Description copied from class IO

Closes this IO.

IO defines this is a no-op method, but including types may override.


[View source]
def close_read : Nil #

[View source]
def read(slice : Bytes) : Int32 #

Reads previously buffered Data.

If window size falls below half buffer capacity, sends a WindowUpdate frame to increment the window size by half the buffer size, which fits into the buffer's remaining space.


[View source]
def size : Int32 #

Returns the collected size in bytes of streamed Data frames.


[View source]