package config
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/query/config"
Index ¶
- Constants
- type Config
- func New(opts ...Option) *Config
- func (c *Config) Clock() clockwork.Clock
- func (c *Config) CreateSessionTimeout() time.Duration
- func (c *Config) DeleteTimeout() time.Duration
- func (c *Config) IdleThreshold() time.Duration
- func (c *Config) SizeLimit() int
- func (c *Config) Trace() *trace.Query
- type Option
Constants ¶
const ( DefaultSessionPoolDeleteTimeout = 500 * time.Millisecond DefaultSessionPoolCreateSessionTimeout = 5 * time.Second DefaultSessionPoolSizeLimit = 50 DefaultSessionPoolIdleThreshold = 5 * time.Minute )
Types ¶
type Config ¶
func New ¶
func (*Config) Clock ¶
Clock defines clock
func (*Config) CreateSessionTimeout ¶
CreateSessionTimeout limits maximum time spent on Create session request
func (*Config) DeleteTimeout ¶
DeleteTimeout limits maximum time spent on Delete request
If DeleteTimeout is less than or equal to zero then the DefaultSessionPoolDeleteTimeout is used.
func (*Config) IdleThreshold ¶
IdleThreshold is a maximum duration between any activity within session. If this threshold reached, idle session will be closed
If IdleThreshold is less than zero then there is no idle limit. If IdleThreshold is zero, then the DefaultSessionPoolIdleThreshold value is used.
func (*Config) SizeLimit ¶
SizeLimit is an upper bound of pooled sessions. If SizeLimit is less than or equal to zero then the DefaultSessionPoolSizeLimit variable is used as a limit.
func (*Config) Trace ¶
Trace defines trace over table client calls
type Option ¶
type Option func(*Config)
func With ¶
With applies common configuration params
func WithCreateSessionTimeout ¶
WithCreateSessionTimeout limits maximum time spent on Create session request If createSessionTimeout is less than or equal to zero then no used timeout on create session request
func WithDeleteTimeout ¶
WithDeleteTimeout limits maximum time spent on Delete request If deleteTimeout is less than or equal to zero then the DefaultSessionPoolDeleteTimeout is used.
func WithIdleThreshold ¶
WithIdleThreshold sets maximum duration between any activity within session. If this threshold reached, session will be closed.
If idleThreshold is less than zero then there is no idle limit. If idleThreshold is zero, then the DefaultSessionPoolIdleThreshold value is used.
func WithSizeLimit ¶
WithSizeLimit defines upper bound of pooled sessions. If sizeLimit is less than or equal to zero then the DefaultSessionPoolSizeLimit variable is used as a limit.
Source Files ¶
- Version
- v3.54.4-rc0
- Published
- Jan 18, 2024
- Platform
- windows/amd64
- Imports
- 4 packages
- Last checked
- 14 seconds ago –
Tools for package owners.