ark::pipeline::TimerStage

Defined in header “ark/pipeline/testing/timer_stage.hh”.


This is a stage that allows you to wrap a callback and will allow you to publish a message on some fixed interval, indefinitely.

The CallbackFunction signature allows you to return the type that you wish to publish. If you don’t want to publish anything on a cycle, simply return an empty optional. It is considered a convenience routine for testing.

Typedefs

  • using CallbackFunction = std::function< std::optional< PublisherType >()>
    The signature for your callback function. Returns the type that you wish to see published (or an empty optional if you don’t want to publish anything).

Methods

  • TimerStage(std::string publisher_channel, CallbackFunction callback, std::chrono::nanoseconds interval, std::chrono::nanoseconds expected_runtime)
    Constructor. Invokes at the fixed interval specified.

  • void initialize(pipeline::StageInterface & interface)
    Called from the executor when we are initialized.