Skip to content

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.


If other services depend on your script, your script must print a specific line to stdout when it is ready to work.

import sys
# Do setup work...
setup_database()
# Signal readiness (flush is critical!)
print("SERVICE_READY", flush=True)
# Start main loop...
const server = app.listen(3000, () => {
console.log("SERVICE_READY");
});
print("SERVICE_READY")
io.stdout:flush() -- Lua buffers output, so explicit flush is often needed

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 signal
import sys
def handler(signum, frame):
print("Saving state and exiting...")
sys.exit(0)
signal.signal(signal.SIGTERM, handler)