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:
committed by
Marcos Nils
parent
65b8364ef2
commit
d758c1a303
@@ -15,13 +15,14 @@ var (
|
||||
SESSION_END = EventType("session end")
|
||||
SESSION_READY = EventType("session ready")
|
||||
SESSION_BUILDER_OUT = EventType("session builder out")
|
||||
PLAYGROUND_NEW = EventType("playground_new")
|
||||
)
|
||||
|
||||
type Handler func(sessionId string, args ...interface{})
|
||||
type AnyHandler func(eventType EventType, sessionId string, args ...interface{})
|
||||
type Handler func(id string, args ...interface{})
|
||||
type AnyHandler func(eventType EventType, id string, args ...interface{})
|
||||
|
||||
type EventApi interface {
|
||||
Emit(name EventType, sessionId string, args ...interface{})
|
||||
Emit(name EventType, id string, args ...interface{})
|
||||
On(name EventType, handler Handler)
|
||||
OnAny(handler AnyHandler)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user