package bgreader
import "github.com/jackc/pgx/v5/pgconn/internal/bgreader"
Package bgreader provides a io.Reader that can optionally buffer reads in the background.
Index ¶
Constants ¶
const ( StatusStopped = iota StatusRunning StatusStopping )
Types ¶
type BGReader ¶
type BGReader struct {
// contains filtered or unexported fields
}
BGReader is an io.Reader that can optionally buffer reads in the background. It is safe for concurrent use.
func New ¶
func (*BGReader) Read ¶
Read implements the io.Reader interface.
func (*BGReader) Start ¶
func (r *BGReader) Start()
Start starts the backgrounder reader. If the background reader is already running this is a no-op. The background reader will stop automatically when the underlying reader returns an error.
func (*BGReader) Status ¶
Status returns the current status of the background reader.
func (*BGReader) Stop ¶
func (r *BGReader) Stop()
Stop tells the background reader to stop after the in progress Read returns. It is safe to call Stop when the background reader is not running.
Source Files ¶
- Version
- v5.7.2 (latest)
- Published
- Dec 21, 2024
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 5 days ago –
Tools for package owners.