Grains v0.3.2 Grains.DebugTimer
Debug version of Grains.Timer
.
To replace the normal Timer with this, start you bread like this:
default_grains = Map.merge(Grains.default_grains, %{periodic: Grains.DebugTimer})
{:ok, bread} = Grains.Supervisor.start_link(recipe, grains, default_grains)
server = Grains.get_name(bread, State)
debug_timer = Grains.get_name(bread, State.Sampler.Timer)
send(debug_timer, :tick)
With Timestamps
Similarly to Grains.Timer
, the debug timer accepts an option with_timestamps
. If set to
true, the :tick
must include a timestamp, which is then used when forwarding the received
message downstream. If with_timestamps
is not set, the :tick
must not include a timestamp,
and the message is forwarded as-is.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Callback implementation for GenServer.init/1
.
Link to this section Functions
Link to this function
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
Link to this function
handle_pull(from, state)
Link to this function
handle_push(msg, from, state)
Link to this function
init(opts)
Callback implementation for GenServer.init/1
.
Link to this function
name(left, grain)
See Grains.Timer.name/2
.
Link to this function
own_full_name()
Link to this function
own_name()
Link to this function
pull()
Link to this function
pull(from)
Link to this function
pull_with_tag(tag)
Link to this function
pull_with_tag(from, tag)
Link to this function
push(msg)
Link to this function