package pool
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/pool"
Index ¶
- Constants
- func WithClock[PT Item[T], T any](clock clockwork.Clock) option[PT, T]
- func WithCloseItemTimeout[PT Item[T], T any](t time.Duration) option[PT, T]
- func WithCreateItemFunc[PT Item[T], T any](f func(ctx context.Context) (PT, error)) option[PT, T]
- func WithCreateItemTimeout[PT Item[T], T any](t time.Duration) option[PT, T]
- func WithIdleThreshold[PT Item[T], T any](idleThreshold time.Duration) option[PT, T]
- func WithLimit[PT Item[T], T any](size int) option[PT, T]
- func WithSyncCloseItem[PT Item[T], T any]() option[PT, T]
- func WithTrace[PT Item[T], T any](t *Trace) option[PT, T]
- type Config
- type Item
- type Pool
- func New[PT Item[T], T any]( ctx context.Context, opts ...option[PT, T], ) *Pool[PT, T]
- func (p *Pool[PT, T]) Close(ctx context.Context) (finalErr error)
- func (p *Pool[PT, T]) Stats() Stats
- func (p *Pool[PT, T]) With( ctx context.Context, f func(ctx context.Context, item PT) error, opts ...retry.Option, ) (finalErr error)
- type Stats
- type Trace
Constants ¶
const (
DefaultLimit = 50
)
Functions ¶
func WithClock ¶
func WithCloseItemTimeout ¶
func WithCreateItemFunc ¶
func WithCreateItemTimeout ¶
func WithIdleThreshold ¶
func WithLimit ¶
func WithSyncCloseItem ¶
func WithTrace ¶
Types ¶
type Config ¶
type Item ¶
type Pool ¶
func New ¶
func (*Pool[PT, T]) Close ¶
func (*Pool[PT, T]) Stats ¶
func (p *Pool[PT, T]) Stats() Stats
func (*Pool[PT, T]) With ¶
func (p *Pool[PT, T]) With( ctx context.Context, f func(ctx context.Context, item PT) error, opts ...retry.Option, ) (finalErr error)
type Stats ¶
type Trace ¶
type Trace struct { OnNew func(ctx *context.Context, call stack.Caller) func(limit int) OnClose func(ctx *context.Context, call stack.Caller) func(err error) OnTry func(ctx *context.Context, call stack.Caller) func(err error) OnWith func(ctx *context.Context, call stack.Caller) func(attempts int, err error) OnPut func(ctx *context.Context, call stack.Caller, item any) func(err error) OnGet func(ctx *context.Context, call stack.Caller) func(item any, attempts int, err error) OnChange func(Stats) // contains filtered or unexported fields }
Source Files ¶
defaults.go errors.go pool.go stats.go trace.go
- Version
- v3.80.1
- Published
- Sep 8, 2024
- Platform
- linux/amd64
- Imports
- 14 packages
- Last checked
- 11 minutes ago –
Tools for package owners.