sync

package
v1.15.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package sync contains structs to extend sync stdlib

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory func() interface{}

Factory is a function to create new connections

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

Pool holds Clients

func NewPool

func NewPool(maxCap uint, factory Factory) *Pool

NewPool creates a new pool of interface.

func (*Pool) Get

func (p *Pool) Get() (rv interface{})

func (*Pool) GetCapacity

func (p *Pool) GetCapacity() uint

GetCapacity return defined pool capacity

func (*Pool) Put

func (p *Pool) Put(c interface{}) error

func (*Pool) SetFactory

func (p *Pool) SetFactory(factory Factory)

SetFactory declare auto create function

Jump to

Keyboard shortcuts

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