containerd/start.go
Michael Crosby 779cb69e6d Refactor event loop with types
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-01 10:55:13 -08:00

19 lines
371 B
Go

package containerd
type StartEvent struct {
s *Supervisor
}
func (h *StartEvent) Handle(e *Event) error {
container, err := h.s.runtime.Create(e.ID, e.BundlePath, e.Stdio)
if err != nil {
return err
}
h.s.containers[e.ID] = container
ContainersCounter.Inc(1)
h.s.tasks <- &startTask{
err: e.Err,
container: container,
}
return errDeferedResponse
}