Documentation
¶
Overview ¶
Package luastate wraps lua/pool with a Borrow/Return API and scoped helpers. The underlying pool package stays exported for external users of algernon as a library.
Index ¶
- type Pool
- func (p *Pool) Borrow() *lua.LState
- func (p *Pool) New() *lua.LState
- func (p *Pool) Return(L *lua.LState)
- func (p *Pool) Shutdown()
- func (p *Pool) Underlying() *pool.LStatePool
- func (p *Pool) With(fn func(L *lua.LState) error) (err error)
- func (p *Pool) WithNew(fn func(L *lua.LState) error) (err error)
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 wraps lua/pool.LStatePool with a Borrow/Return discipline
func (*Pool) Borrow ¶
Borrow takes a Lua state out of the pool, or creates a new one. Pair with Return.
func (*Pool) New ¶
New returns a fresh Lua state that is not pooled; the caller is responsible for closing it
func (*Pool) Underlying ¶
func (p *Pool) Underlying() *pool.LStatePool
Underlying returns the wrapped *pool.LStatePool, for interop with not-yet-migrated code
Click to show internal directories.
Click to hide internal directories.