package bgreader
Import Path
github.com/jackc/pgx/v5/pgconn/internal/bgreader (on go.dev)
Dependency Relation
imports 3 packages, and imported by one package
Involved Source Files
Package bgreader provides a io.Reader that can optionally buffer reads in the background.
Package-Level Type Names (total 2, in which 1 is exported)
BGReader is an io.Reader that can optionally buffer reads in the background. It is safe for concurrent use.
cond *sync.Cond
r io.Reader
readResults []readResult
status int32
Read implements the io.Reader interface.
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.
Status returns the current status of the background reader.
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.
(*BGReader) bgRead()
readBackgroundResults reads a result previously read by the background reader. r.cond.L must be held.
*BGReader : io.Reader
func New(r io.Reader) *BGReader
Package-Level Constants (total 3, all are exported)
const StatusRunning = 1 const StatusStopped = 0 const StatusStopping = 2The pages are generated with Golds v0.7.6. (GOOS=linux GOARCH=amd64)