Documentation
¶
Index ¶
- Constants
- func StartAllExecutors(ctx context.Context, scriptStore store.ScriptStore, ...) map[string]Executor
- func StopAllExecutors(executors map[string]Executor)
- type Executor
- func ExecutorByName(name string, executors map[string]Executor) (Executor, error)
- func NewLuaExecutor(c context.Context, store msgstore.ScriptStore, ...) Executor
- func NewPodmanExecutor(c context.Context, store msgstore.ScriptStore) (Executor, error)
- func NewWasmExecutor(c context.Context, store msgstore.ScriptStore, ...) Executor
- type LuaExecutor
- type Message
- type NoScriptFoundError
- type Reply
- type ReplyFunc
- type ScriptResult
Constants ¶
View Source
const ( MAX_LUA_RUNNING_TIME = 2 * time.Minute EXECUTOR_LUA_NAME = "lua" EXECUTOR_WASM_NAME = "wasm" EXECUTOR_PODMAN_NAME = "podman" )
Variables ¶
This section is empty.
Functions ¶
func StartAllExecutors ¶ added in v0.7.1
func StartAllExecutors(ctx context.Context, scriptStore store.ScriptStore, plugins []plugins.PreloadFunc, nc *nats.Conn) map[string]Executor
func StopAllExecutors ¶ added in v0.7.1
Types ¶
type Executor ¶
func ExecutorByName ¶ added in v0.7.1
func NewLuaExecutor ¶
func NewLuaExecutor(c context.Context, store msgstore.ScriptStore, plugins []msgplugins.PreloadFunc, nc *nats.Conn) Executor
NewLuaExecutor creates a new ScriptExecutor using the provided ScriptStore
func NewPodmanExecutor ¶ added in v0.4.1
func NewWasmExecutor ¶
func NewWasmExecutor(c context.Context, store msgstore.ScriptStore, plugins []msgplugins.PreloadFunc, nc *nats.Conn) Executor
type LuaExecutor ¶
type LuaExecutor struct {
// contains filtered or unexported fields
}
LuaExecutor defines the structure responsible for managing Lua script execution
func (*LuaExecutor) HandleMessage ¶
func (le *LuaExecutor) HandleMessage(ctx context.Context, msg *Message, rf ReplyFunc)
HandleMessage receives a message, matches it to a Lua script, and executes the script in a new goroutine
func (*LuaExecutor) Stop ¶
func (se *LuaExecutor) Stop()
Stop gracefully shuts down the ScriptExecutor and stops watching for messages
type NoScriptFoundError ¶
type NoScriptFoundError struct{}
func (*NoScriptFoundError) Error ¶
func (e *NoScriptFoundError) Error() string
Click to show internal directories.
Click to hide internal directories.