Documentation
¶
Index ¶
Constants ¶
View Source
const MAX_LUA_RUNNING_TIME = 2 * time.Minute
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NoScriptFoundError ¶ added in v0.2.3
type NoScriptFoundError struct{}
func (*NoScriptFoundError) Error ¶ added in v0.2.3
func (e *NoScriptFoundError) Error() string
type Reply ¶ added in v0.2.1
type Reply struct { Results sync.Map HTML bool `json:"is_html"` Error string `json:"error,omitempty"` AllResults map[string]*ScriptResult `json:"results,omitempty"` }
func NewErrReply ¶ added in v0.2.1
type ScriptExecutor ¶
type ScriptExecutor struct {
// contains filtered or unexported fields
}
ScriptExecutor defines the structure responsible for managing Lua script execution
func NewScriptExecutor ¶
func NewScriptExecutor(store msgstore.ScriptStore, plugins []msgplugins.PreloadFunc, nc *nats.Conn) *ScriptExecutor
NewScriptExecutor creates a new ScriptExecutor using the provided ScriptStore
func (*ScriptExecutor) HandleMessage ¶
func (se *ScriptExecutor) HandleMessage(ctx context.Context, msg *Message, replyFunc func(r *Reply))
HandleMessage receives a message, matches it to a Lua script, and executes the script in a new goroutine
func (*ScriptExecutor) Stop ¶
func (se *ScriptExecutor) Stop()
Stop gracefully shuts down the ScriptExecutor and stops watching for messages
Click to show internal directories.
Click to hide internal directories.