writeconcurrencylimiter

package
v1.101.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 12

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 if r has increased concurrency.

Types

type Reader added in v1.86.0

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

Reader is a reader, which increases the concurrency after the first Read() call

The concurrency can be reduced by calling DecConcurrency(). Then the concurrency is increased after the next Read() call.

func GetReader added in v1.86.0

func GetReader(r io.Reader) *Reader

GetReader returns the Reader for r.

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

func (*Reader) DecConcurrency added in v1.86.0

func (r *Reader) DecConcurrency()

DecConcurrency decreases the concurrency, so it could be increased again after the next Read() call.

func (*Reader) Read added in v1.86.0

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

Read implements io.Reader.

It increases concurrency after the first call or after the next call after DecConcurrency() call.

Jump to

Keyboard shortcuts

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