package pool
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/pool"
Index ¶
- Constants
- func WithCloseItemTimeout[PT Item[T], T any](t time.Duration) option[PT, T]
- func WithCreateFunc[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 WithLimit[PT Item[T], T any](size int) option[PT, T]
- func WithTrace[PT Item[T], T any](t *Trace) option[PT, T]
- type ChangeInfo
- type CloseDoneInfo
- type CloseStartInfo
- type GetDoneInfo
- type GetStartInfo
- type Item
- type NewDoneInfo
- type NewStartInfo
- 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.Stats
- func (p *Pool[PT, T]) With( ctx context.Context, f func(ctx context.Context, item PT) error, opts ...retry.Option, ) (finalErr error)
- type PutDoneInfo
- type PutStartInfo
- type Trace
- type TryDoneInfo
- type TryStartInfo
- type WithDoneInfo
- type WithStartInfo
Constants ¶
const DefaultLimit = 50
Functions ¶
func WithCloseItemTimeout ¶
func WithCreateFunc ¶
func WithCreateItemTimeout ¶
func WithLimit ¶
func WithTrace ¶
Types ¶
type ChangeInfo ¶
type CloseDoneInfo ¶
type CloseDoneInfo struct { Error error }
type CloseStartInfo ¶
type CloseStartInfo struct { // Context make available context in trace stack.Callerback function. // Pointer to context provide replacement of context in trace stack.Callerback function. // Warning: concurrent access to pointer on client side must be excluded. // Safe replacement of context are provided only inside stack.Callerback function Context *context.Context Call stack.Caller }
type GetDoneInfo ¶
type GetDoneInfo struct { Error error }
type GetStartInfo ¶
type GetStartInfo struct { // Context make available context in trace stack.Callerback function. // Pointer to context provide replacement of context in trace stack.Callerback function. // Warning: concurrent access to pointer on client side must be excluded. // Safe replacement of context are provided only inside stack.Callerback function Context *context.Context Call stack.Caller }
type Item ¶
type NewDoneInfo ¶
type NewDoneInfo struct { Limit int }
type NewStartInfo ¶
type NewStartInfo struct { // Context make available context in trace stack.Callerback function. // Pointer to context provide replacement of context in trace stack.Callerback function. // Warning: concurrent access to pointer on client side must be excluded. // Safe replacement of context are provided only inside stack.Callerback function Context *context.Context Call stack.Caller }
type Pool ¶
func New ¶
func (*Pool[PT, T]) Close ¶
func (*Pool[PT, T]) 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 PutDoneInfo ¶
type PutDoneInfo struct { Error error }
type PutStartInfo ¶
type PutStartInfo struct { // Context make available context in trace stack.Callerback function. // Pointer to context provide replacement of context in trace stack.Callerback function. // Warning: concurrent access to pointer on client side must be excluded. // Safe replacement of context are provided only inside stack.Callerback function Context *context.Context Call stack.Caller }
type Trace ¶
type Trace struct { OnNew func(*NewStartInfo) func(*NewDoneInfo) OnClose func(*CloseStartInfo) func(*CloseDoneInfo) OnTry func(*TryStartInfo) func(*TryDoneInfo) OnWith func(*WithStartInfo) func(*WithDoneInfo) OnPut func(*PutStartInfo) func(*PutDoneInfo) OnGet func(*GetStartInfo) func(*GetDoneInfo) OnChange func(ChangeInfo) }
type TryDoneInfo ¶
type TryDoneInfo struct { Error error }
type TryStartInfo ¶
type TryStartInfo struct { // Context make available context in trace stack.Callerback function. // Pointer to context provide replacement of context in trace stack.Callerback function. // Warning: concurrent access to pointer on client side must be excluded. // Safe replacement of context are provided only inside stack.Callerback function Context *context.Context Call stack.Caller }
type WithDoneInfo ¶
type WithStartInfo ¶
type WithStartInfo struct { // Context make available context in trace stack.Callerback function. // Pointer to context provide replacement of context in trace stack.Callerback function. // Warning: concurrent access to pointer on client side must be excluded. // Safe replacement of context are provided only inside stack.Callerback function Context *context.Context Call stack.Caller }
Source Files ¶
defaults.go errors.go pool.go trace.go
Directories ¶
Path | Synopsis |
---|---|
internal/pool/stats |
- Version
- v3.68.1
- Published
- May 24, 2024
- Platform
- linux/amd64
- Imports
- 11 packages
- Last checked
- 1 minute ago –
Tools for package owners.