Disponible
amalgame-service
SIGTERM / SIGINT + Windows SCM dispatcher.
Vue d'ensemble
Intégration daemon/service cross-OS. Sous Linux/macOS : gestion propre des signaux SIGTERM et SIGINT pour shutdown gracieux. Sous Windows : le binaire est un vrai service (dispatcher SCM natif), enregistré avec sc.exe, sans NSSM ni wrapper tiers.
Caractéristiques
- ✓SIGTERM / SIGINT handlers cross-OS
- ✓Windows Service Control Manager natif (depuis v0.2)
- ✓
amc new --template servicefournit l'unité systemd et le plist launchd - ✓Le même modèle fournit les scripts d'installation
install.sh,install-macos.shetinstall.ps1 - ✓
Service.Sleep(ms)rend la main dès l'arrêt ;Service.RequestStop()arrête depuis le programme
Exemple
Exemple minimal d'utilisation — recopiable tel quel après l'install.
amc package add service
import Amalgame.Service
class Program {
public static int Main(List<string> args) {
Service.RunAsService("my-app") // SIGTERM / SIGINT ; sous Windows, le SCM aussi
while (!Service.ShouldStop()) {
Console.WriteLine("working")
Service.Sleep(5000) // rend la main dès l'arrêt
}
Console.WriteLine("clean shutdown")
return 0
}
}
En bref
- Licence : Apache-2.0
- Installation :
amc package add service - Code source : amalgame-lang/amalgame-service
- Index officiel : amalgame-lang/packages-index