rbufd

Create a ring buffer to manage the data from the given source, and wrap into an iopipe.

The iopipe RingBuffer type uses virtual memory mapping to have the same segment of data mapped to consecutive addresses. This allows true zero-copy usage. However, it does require use of resources that may possibly be limited, so you may want to justify that it's needed before using instead of bufd.

Note also that a RingBuffer is not copyable (its destructor will unmap the memory), so this must use RefCounted to properly work.

  1. auto rbufd(Source dev)
  2. auto rbufd()
    rbufd
    (
    T = ubyte
    size_t optimalReadSize = 8 * 1024 / T.sizeof
    )
    ()

Return Value

Type: auto

An iopipe that uses a RingBuffer to read data from the given device source.

Meta