writeconcurrencylimiter

package
v1.134.0-cluster Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 11 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PutReader added in v1.86.0

func PutReader(r *Reader)

PutReader returns the r to the pool.

It decreases the concurrency.

Types

type Reader added in v1.86.0

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

Reader is a reader, which decreases the concurrency before every Read() call and increases the concurrency after Read() call.

It effectively limits the number of concurrent goroutines, which may process results returned by concurrently processed Reader structs.

The Reader must be obtained via GetReader() call.

func GetReader added in v1.86.0

func GetReader(r io.Reader) (*Reader, error)

GetReader returns the Reader for r.

The PutReader() must be called when the returned Reader is no longer needed.

func (*Reader) Read added in v1.86.0

func (r *Reader) Read(p []byte) (int, error)

Read implements io.Reader.

Jump to

Keyboard shortcuts

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