asyncwriter

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package asyncwriter contains an asynchronous writer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

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

Writer is an asynchronous writer.

func New

func New(
	queueSize int,
	parent logger.Writer,
) *Writer

New allocates a Writer.

func (*Writer) Error

func (w *Writer) Error() chan error

Error returns whenever there's an error.

func (*Writer) Push

func (w *Writer) Push(cb func() error)

Push appends an element to the queue.

func (*Writer) Start

func (w *Writer) Start()

Start starts the writer routine.

func (*Writer) Stop

func (w *Writer) Stop()

Stop stops the writer routine.

Jump to

Keyboard shortcuts

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