sasa-b / overseer.go

Simple golang process manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Overseer logo

Overseer

Project name Build status Go Report Card

Simple process manager library.

The useful methods are:

  • NewOverseer() - Returns a new instance of a process manager.
  • To register processes, use the Add(id string, args ...string) method, and to unregister use the Remove(id string) method.
  • SuperviseAll() - This is the main function. Supervise all processes and block until they finish. This includes killing all the processes when the main program exits.
  • Supervise(id string) - Supervise one registered process and block until it finishes. This includes checking if the process was killed from the outside, delaying the start and restarting in case of failure.
  • Stop(id string) - Stops the process by sending its process group a SIGTERM signal.
  • Signal(id string, sig syscall.Signal) - Sends an OS signal to the process group.
  • StopAll() - Cycles and stops all processes by sending SIGTERM.

Highlights:

  • real-time stdout and stderr
  • real-time status
  • complete and consolidated return
  • proper process termination on exit
  • portable command line binary for managing procs
  • heavily tested, good coverage
  • no race conditions

For examples of usage, please check the tests, or the command line script (for now). The API is not fixed yet.

Similar libraries

Icon is made by Freepik from www.flaticon.com and licensed by CC 3.0 BY.


License

MIT © Cristi Constantin.

About

Simple golang process manager

License:MIT License


Languages

Language:Go 100.0%