Closed luizkowalski closed 8 years ago
Notifiers are not called when the light transitions from red to yellow. Notifiers are only called from green to red and red to green. See the Runnable
module for the code.
You can query a stoplight directly for its current color. That means that instead of setting up a LightObserver
, you could do this:
def stoplight_color(name)
Stoplight(name) { nil }
.with_cool_off_time(15) # Must be the same as in the `stoplight` method.
.color
end
you are right, I got it Thanks
I have a circuit like this
that I use for different purpose (e.g. call facebook api, google api). I also want to expose the status to our health monitor. So that I decide to create a new notifier that will save the color to redis everytime a status is changed
when the status changed to red, LightObserver is invoked, but when change to yellow, nothing happen. I also didn't noticed the status going back to green ever.