Plugin Development
Turbostar is language-agnostic.
“If it can run in a shell, it can be a Turbostar plugin.” - said nobody
However, to utilize features like Dependency Graphing, your scripts need to output logs in a specific way.
The “Ready” Protocol
Section titled “The “Ready” Protocol”If other services depend on your script, your script must print a specific line to stdout when it is ready to work.
Python Example
Section titled “Python Example”import sys
# Do setup work...setup_database()
# Signal readiness (flush is critical!)print("SERVICE_READY", flush=True)
# Start main loop...Node.js Example
Section titled “Node.js Example”const server = app.listen(3000, () => { console.log("SERVICE_READY");});Lua Example
Section titled “Lua Example”print("SERVICE_READY")io.stdout:flush() -- Lua buffers output, so explicit flush is often neededHandling Shutdowns
Section titled “Handling Shutdowns”Turbostar sends a SIGTERM signal when you press Ctrl+C. Your scripts should handle this gracefully to avoid data corruption.
An example in Python:
import signalimport sys
def handler(signum, frame): print("Saving state and exiting...") sys.exit(0)
signal.signal(signal.SIGTERM, handler)