github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/client/allocrunner/taskrunner/interfaces/lifecycle.go (about) 1 package interfaces 2 3 import ( 4 "context" 5 6 "github.com/hashicorp/nomad/nomad/structs" 7 ) 8 9 type TaskLifecycle interface { 10 // Restart a task in place. If failure=false then the restart does not 11 // count as an attempt in the restart policy. 12 Restart(ctx context.Context, event *structs.TaskEvent, failure bool) error 13 14 // Sends a signal to a task. 15 Signal(event *structs.TaskEvent, signal string) error 16 17 // Kill a task permanently. 18 Kill(ctx context.Context, event *structs.TaskEvent) error 19 }