class Rooibos::Message::Clock
Response from a clock command.
Long-lived applications display the time. Dashboards show “last updated 30 seconds ago.” Schedulers fire actions at specific hours. All of these need wall-clock time. But calling Time.now in Update is a side effect—the same model and message produce different results depending on when you call them.
This response carries the wall-clock time from the runtime. Update pattern-matches on the envelope to distinguish multiple clocks.
Use it to handle Command.clock completions.
Example
case msg in { type: :clock, envelope: :refresh, time: } [model.with(last_refresh: time), Command.clock(1, :refresh)] in { type: :clock, envelope: :display, time: } model.with(current_time: time.utc.to_s) end
Public Instance Methods
Source
# File lib/rooibos/message/clock.rb, line 35 def clock? true end
Returns true for clock responses.