cdb5947f86
Signed-off-by: John Howard <jhoward@microsoft.com>
33 lines
647 B
Go
33 lines
647 B
Go
package supervisor
|
|
|
|
func (s *Supervisor) handleTask(i Task) {
|
|
var err error
|
|
switch t := i.(type) {
|
|
case *AddProcessTask:
|
|
err = s.addProcess(t)
|
|
case *StartTask:
|
|
err = s.start(t)
|
|
case *DeleteTask:
|
|
err = s.delete(t)
|
|
case *ExitTask:
|
|
err = s.exit(t)
|
|
case *ExecExitTask:
|
|
err = s.execExit(t)
|
|
case *GetContainersTask:
|
|
err = s.getContainers(t)
|
|
case *SignalTask:
|
|
err = s.signal(t)
|
|
case *StatsTask:
|
|
err = s.stats(t)
|
|
case *UpdateTask:
|
|
err = s.updateContainer(t)
|
|
case *UpdateProcessTask:
|
|
err = s.updateProcess(t)
|
|
default:
|
|
err = ErrUnknownTask
|
|
}
|
|
if err != errDeferedResponse {
|
|
i.ErrorCh() <- err
|
|
close(i.ErrorCh())
|
|
}
|
|
}
|