pool

package
v0.0.0-...-aa1fe35 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

Pool is a pool of *lua.State

func New

func New(config *config.Config, initializer func(*lua.State) error) (*Pool, error)

New gets you a *Pool of fully initialized *lua.State Needs the initial size of the pool and an initializer function The initializer will be reused later when the pool grows to meet peak demand

func (*Pool) Cleanup

func (p *Pool) Cleanup()

Cleanup the pool and all of its state

func (*Pool) Return

func (p *Pool) Return(state *lua.State)

Return a *lua.State back to the pool

func (*Pool) Take

func (p *Pool) Take() (state *lua.State, err error)

Take a *lua.State from the pool Provisions and initializes a new one if the pool is empty

Jump to

Keyboard shortcuts

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