multi-script

command
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Command multi-script demonstrates a thread-safe runtime that runs MANY Lua scripts from MANY goroutines, addressing two concerns the simpler bytecode-cache / pool-preload examples leave open:

Concern 1 (concurrent compile): even when many goroutines request the same
            script for the first time at once, it compiles exactly once
            (per-key sync.Once), while different scripts compile in parallel
            (the global lock is held only for the map lookup).
Concern 2 (GC vs Pool): VM pooling is offered in two strategies — sync.Pool
            (GC may reclaim) and a fixed channel pool (persistent, predictable
            memory).

Engine: lua-pure (github.com/htcom-code/lua-pure).

Jump to

Keyboard shortcuts

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