resources: Improve the state/cache system

Refactor the state cache into the engine. This makes resource writing
less error prone, and paves the way for better notifications.
This commit is contained in:
James Shubin
2016-11-25 12:30:29 -05:00
parent ba6044e9e8
commit b0a8fc165c
13 changed files with 95 additions and 176 deletions

View File

@@ -114,7 +114,6 @@ func (obj *TimerRes) Watch(processChan chan event.Event) error {
if send {
startup = true // startup finished
send = false
//obj.isStateOK = false
if exit, err := obj.DoSend(processChan, "timer ticked"); exit || err != nil {
return err // we exit or bubble up a NACK...
}
@@ -162,6 +161,5 @@ func (obj *TimerRes) Compare(res Res) bool {
// CheckApply method for Timer resource. Does nothing, returns happy!
func (obj *TimerRes) CheckApply(apply bool) (bool, error) {
log.Printf("%s[%s]: CheckApply(%t)", obj.Kind(), obj.GetName(), apply)
return true, nil // state is always okay
}