graceful_shutdown_intf.go 425 B

12345678910111213141516171819202122232425
  1. package rpcore
  2. import (
  3. "context"
  4. "os/exec"
  5. )
  6. type ShutdownInfo struct {
  7. CPID int64
  8. Name string
  9. PID int
  10. Cmd *exec.Cmd
  11. LogEmitFunc func(text string)
  12. }
  13. type GracefulShutdownActor interface {
  14. Shutdown(info *ShutdownInfo, ctx context.Context) bool
  15. }
  16. type DummyShutdownActor struct {
  17. }
  18. func (d DummyShutdownActor) Shutdown(info *ShutdownInfo, ctx context.Context) bool {
  19. return false
  20. }