Rename Events to task in supervisor

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-02-11 17:26:24 -08:00
parent d2bf71043f
commit 3dc59d565a
18 changed files with 274 additions and 281 deletions

View file

@ -6,13 +6,13 @@ import (
"github.com/docker/containerd/runtime"
)
type AddProcessEvent struct {
type AddProcessTask struct {
s *Supervisor
}
// TODO: add this to worker for concurrent starts??? maybe not because of races where the container
// could be stopped and removed...
func (h *AddProcessEvent) Handle(e *Event) error {
func (h *AddProcessTask) Handle(e *Task) error {
start := time.Now()
ci, ok := h.s.containers[e.ID]
if !ok {
@ -27,5 +27,11 @@ func (h *AddProcessEvent) Handle(e *Event) error {
}
ExecProcessTimer.UpdateSince(start)
e.StartResponse <- StartResponse{}
h.s.notifySubscribers(Event{
Timestamp: time.Now(),
Type: "start-process",
Pid: e.Pid,
ID: e.ID,
})
return nil
}