pools

package
v0.0.0-...-27647ab Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnyDrainPool

type AnyDrainPool interface {
	Type() reflect.Type
	Stats() DrainPoolStats
	Drain() int
}

type AnyLinkedPool

type AnyLinkedPool interface {
	Unwrap() any
	Link() *LinkedPoolLink
}

type DrainPool

type DrainPool[T any] struct {
	// contains filtered or unexported fields
}

func NewDrainPool

func NewDrainPool[T any](fn func() T) *DrainPool[T]

func (*DrainPool[T]) Drain

func (p *DrainPool[T]) Drain() int

func (*DrainPool[T]) Get

func (p *DrainPool[T]) Get() T

func (*DrainPool[T]) Put

func (p *DrainPool[T]) Put(x T)

func (*DrainPool[T]) Stats

func (p *DrainPool[T]) Stats() DrainPoolStats

func (*DrainPool[T]) Type

func (p *DrainPool[T]) Type() reflect.Type

type DrainPoolStats

type DrainPoolStats struct {
	New, Put, Get, Drain int64
}

type LinkedPool

type LinkedPool[T any] struct {
	// contains filtered or unexported fields
}

func NewLinkedPool

func NewLinkedPool[T any](p Pool[T]) *LinkedPool[T]

func (*LinkedPool[T]) Get

func (p *LinkedPool[T]) Get() T
func (p *LinkedPool[T]) Link() *LinkedPoolLink

func (*LinkedPool[T]) Put

func (p *LinkedPool[T]) Put(x T)

func (*LinkedPool[T]) Unwrap

func (p *LinkedPool[T]) Unwrap() any
type LinkedPoolLink struct {
	// contains filtered or unexported fields
}

func (LinkedPoolLink) Next

func (l LinkedPoolLink) Next() AnyLinkedPool

func (LinkedPoolLink) Prev

func (l LinkedPoolLink) Prev() AnyLinkedPool
func (l *LinkedPoolLink) Unlink()

type Pool

type Pool[T any] interface {
	Get() T
	Put(x T)
}

type StubPool

type StubPool[T any] struct {
	New func() T
}

func (StubPool[T]) Get

func (p StubPool[T]) Get() T

func (StubPool[T]) Put

func (p StubPool[T]) Put(x T)

type SyncPool

type SyncPool[T any] struct {
	// contains filtered or unexported fields
}

func NewSyncPool

func NewSyncPool[T any](fn func() T) *SyncPool[T]

func (*SyncPool[T]) Get

func (p *SyncPool[T]) Get() T

func (*SyncPool[T]) Put

func (p *SyncPool[T]) Put(x T)

type TrackingPool

type TrackingPool[T any] struct {
	// contains filtered or unexported fields
}

func NewTrackingPool

func NewTrackingPool[T any](o Pool[T], k func(T) uintptr) *TrackingPool[T]

func (*TrackingPool[T]) Get

func (p *TrackingPool[T]) Get() T

func (*TrackingPool[T]) Put

func (p *TrackingPool[T]) Put(v T)

type WrappedSyncPool

type WrappedSyncPool[T any] struct {
	// contains filtered or unexported fields
}

func WrapSyncPool

func WrapSyncPool[T any](o *sync.Pool) WrappedSyncPool[T]

func (WrappedSyncPool[T]) Get

func (p WrappedSyncPool[T]) Get() T

func (WrappedSyncPool[T]) Put

func (p WrappedSyncPool[T]) Put(x T)

Jump to

Keyboard shortcuts

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