When playground is created or modified it emits an event. (#225)

The scheduler listens to playground events and updates it's
configuration immediately.
This commit is contained in:
Jonathan Leibiusky
2017-11-23 13:40:06 -03:00
committed by Marcos Nils
parent 65b8364ef2
commit d758c1a303
4 changed files with 24 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ package pwd
import (
"log"
"github.com/play-with-docker/play-with-docker/event"
"github.com/play-with-docker/play-with-docker/pwd/types"
"github.com/satori/go.uuid"
)
@@ -14,6 +15,7 @@ func (p *pwd) PlaygroundNew(playground types.Playground) (*types.Playground, err
return nil, err
}
p.event.Emit(event.PLAYGROUND_NEW, playground.Id)
return &playground, nil
}