Documentation
¶
Overview ¶
Package lua implements LuaState Manages. It Wraps gopher-lua as runner.
Index ¶
- Constants
- Variables
- func AddLuaPath(p string) error
- func SetLuaPath(p string) error
- type LuaStatePool
- func (lp *LuaStatePool) Close(l *lua.LState)
- func (lp *LuaStatePool) Get() (*lua.LState, error)
- func (lp *LuaStatePool) New() (*lua.LState, error)
- func (lp *LuaStatePool) NewLuaStatePool(whenNew NewFunc, size int) *LuaStatePool
- func (lp *LuaStatePool) Put(l *lua.LState)
- func (lp *LuaStatePool) Shutdown()
- type NewFunc
Constants ¶
View Source
const (
// lua state pool size default to 10
DEFAULT_LUA_STATE_POOL_SIZE = 10
)
Variables ¶
View Source
var ( OldLuaPathDefault = lua.LuaPathDefault ErrLuaStatePoolFull = errors.New("lua state pool fulled") )
Functions ¶
func SetLuaPath ¶
Types ¶
type LuaStatePool ¶
type LuaStatePool struct {
// contains filtered or unexported fields
}
func (*LuaStatePool) Close ¶
func (lp *LuaStatePool) Close(l *lua.LState)
func (*LuaStatePool) Get ¶
func (lp *LuaStatePool) Get() (*lua.LState, error)
get one lua state from pool
func (*LuaStatePool) New ¶
func (lp *LuaStatePool) New() (*lua.LState, error)
func (*LuaStatePool) NewLuaStatePool ¶
func (lp *LuaStatePool) NewLuaStatePool(whenNew NewFunc, size int) *LuaStatePool
Click to show internal directories.
Click to hide internal directories.