Available
amalgame-service
SIGTERM / SIGINT + Windows SCM dispatcher.
Overview
Cross-OS daemon/service integration. Linux/macOS: clean SIGTERM and SIGINT handling for graceful shutdown. Windows: the binary is a real service (native SCM dispatcher), registered with sc.exe, no NSSM or third-party wrapper.
Features
- ✓Cross-OS SIGTERM / SIGINT handlers
- ✓Native Windows Service Control Manager (since v0.2)
- ✓
amc new --template servicescaffolds the systemd unit and the launchd plist - ✓The same template ships the
install.sh,install-macos.shandinstall.ps1install scripts - ✓
Service.Sleep(ms)returns as soon as shutdown starts;Service.RequestStop()stops from inside the program
Example
Minimal usage example — copy-paste runnable after install.
amc package add service
import Amalgame.Service
class Program {
public static int Main(List<string> args) {
Service.RunAsService("my-app") // SIGTERM / SIGINT; on Windows, the SCM too
while (!Service.ShouldStop()) {
Console.WriteLine("working")
Service.Sleep(5000) // returns early on shutdown
}
Console.WriteLine("clean shutdown")
return 0
}
}
At a glance
- License: Apache-2.0
- Install:
amc package add service - Source: amalgame-lang/amalgame-service
- Official index: amalgame-lang/packages-index