executor

package
v0.0.0-...-d02bcf7 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package executor 是lua并发执行器

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLuaWorker

func NewLuaWorker(entryFile string, funcName string, searchPath ...string) (*luaWorker, error)

NewLuaWorker 构造器

Types

type Config

type Config struct {
	WorkerNum     int
	MaxTask       int      // 最大消息数
	TimeoutMS     int64    // 超时时间
	RecycleTimes  int      // 计算这么多次之后强制创建新的worker
	LuaEntryFile  string   // lua入口脚本
	LuaEntryFunc  string   // lua入口函数
	LuaSearchPath []string // lua搜索目录
}

Config 配置

type Manager

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

Manager 管理器

func NewManager

func NewManager(cfg Config) *Manager

NewManager 构造

func (*Manager) Close

func (m *Manager) Close()

Close 关闭

func (*Manager) Process

func (m *Manager) Process(ctx context.Context, data []byte) <-chan []byte

Process 执行参数

func (*Manager) RecreateNewWorker

func (m *Manager) RecreateNewWorker()

RecreateNewWorker 创建新的worker

func (*Manager) Run

func (m *Manager) Run()

Run run

Jump to

Keyboard shortcuts

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