Documentation
¶
Overview ¶
Package sync is utilities for synchronization
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool[K any] interface { PoolGetter[K] PoolReleaser[K] }
Pool is a combination interface of PoolGetter and PoolReleaser
func NewDefaultTypedPoolWithTelemetry ¶
func NewDefaultTypedPoolWithTelemetry[K any](tm telemetry.Component, module string, name string) Pool[K]
NewDefaultTypedPoolWithTelemetry creates a TypedPool with telemetry using the default `new` function to create instances of K module and name are used to identify the pool in the telemetry
type PoolGetter ¶
type PoolGetter[K any] interface { Get() *K }
PoolGetter is interface that wraps a sync.Pool Get function
type PoolReleaser ¶
type PoolReleaser[K any] interface { Put(*K) }
PoolReleaser is interface that wraps a sync.Pool Put function
type TypedPool ¶
type TypedPool[K any] struct { // contains filtered or unexported fields }
TypedPool is a type-safe version of sync.Pool
func NewDefaultTypedPool ¶
NewDefaultTypedPool creates a TypedPool using the default `new` function to create instances of K
func NewSlicePool ¶
NewSlicePool creates a TypedPool using `make` to create slices of specified size and capacity for instances of []K
func NewTypedPool ¶
NewTypedPool creates a TypedPool using the provided function to create instances of K