This commit is contained in:
Alex Dadgar 2018-07-16 17:40:04 -07:00 committed by Michael Schurter
parent 86e81947b4
commit 89b4ba9cc8

View file

@ -54,6 +54,8 @@ type TaskPrestartResponse struct {
type TaskPrestartHook interface { type TaskPrestartHook interface {
TaskHook TaskHook
// Prestart is called before the task is started.
Prestart(context.Context, *TaskPrestartRequest, *TaskPrestartResponse) error Prestart(context.Context, *TaskPrestartRequest, *TaskPrestartResponse) error
} }
@ -64,6 +66,8 @@ type TaskPoststartResponse struct{}
type TaskPoststartHook interface { type TaskPoststartHook interface {
TaskHook TaskHook
// Poststart is called after the task has started.
Poststart(context.Context, *TaskPoststartRequest, *TaskPoststartResponse) error Poststart(context.Context, *TaskPoststartRequest, *TaskPoststartResponse) error
} }
@ -72,6 +76,8 @@ type TaskKillResponse struct{}
type TaskKillHook interface { type TaskKillHook interface {
TaskHook TaskHook
// Kill is called when a task is going to be killed.
Kill(context.Context, *TaskKillRequest, *TaskKillResponse) error Kill(context.Context, *TaskKillRequest, *TaskKillResponse) error
} }
@ -80,6 +86,8 @@ type TaskExitedResponse struct{}
type TaskExitedHook interface { type TaskExitedHook interface {
TaskHook TaskHook
// Exited is called when a task exits and may or may not be restarted.
Exited(context.Context, *TaskExitedRequest, *TaskExitedResponse) error Exited(context.Context, *TaskExitedRequest, *TaskExitedResponse) error
} }
@ -98,5 +106,7 @@ type TaskStopResponse struct{}
type TaskStopHook interface { type TaskStopHook interface {
TaskHook TaskHook
// Stop is called after the task has exited and will not be started again.
Stop(context.Context, *TaskStopRequest, *TaskStopResponse) error Stop(context.Context, *TaskStopRequest, *TaskStopResponse) error
} }