bufferqueue

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 1 Imported by: 0

README

bufferqueue

GitHub go.mod Go version GitHub tag (latest by date) GitHub branch checks state GoDoc

import (
    "github.com/xen0n/bufferqueue" // package bufferqueue
)

A simple single-producer single-consumer buffer queue that only copies its incoming data once, for every Read() from it. Zero-copy is not possible given the semantic of io.Reader.

Beware: This implementation might be extremely buggy, do not put into production yet without much testing.

License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BBQ

type BBQ struct {
	// contains filtered or unexported fields
}

BBQ is a byte buffer queue that only copies data when it is read. The zero value of a BBQ is ready to use. This type is not designed for multi-producer or multi-consumer use.

func New

func New() *BBQ

func (*BBQ) MarkEOF

func (b *BBQ) MarkEOF()

func (*BBQ) QueueBuffer

func (b *BBQ) QueueBuffer(buf []byte)

func (*BBQ) Read

func (b *BBQ) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL