golua

package
v0.0.0-...-0dcc19d Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LuaWorker

func LuaWorker(c *gin.Context)

每个请求的worker

Types

type LStatePool

type LStatePool struct {
	HPath string
	Htmls map[string][]byte
	FnVM  *lua.LState
	Luas  string
	Fns   map[string]*lua.LFunction
	VMs   chan *lua.LState
}

lua虚拟机池

var (
	LuaPool *LStatePool
)

func (*LStatePool) Init

func (pl *LStatePool) Init(s string) error

初始化若干个虚拟机放入channel待用

func (*LStatePool) LoadHtml

func (pl *LStatePool) LoadHtml(path string) error

func (*LStatePool) MonitorHtml

func (pl *LStatePool) MonitorHtml()

func (*LStatePool) Shutdown

func (pl *LStatePool) Shutdown()

结束后关闭所有channel中的虚拟机

Jump to

Keyboard shortcuts

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