ark::pipeline::Stage

Defined in header “ark/pipeline/stage.hh”.


A stage is a step within a pipeline. This allows you to receive inputs, write outputs, execute periodically, and more. This makes up a core execution step within your pipeline.

Methods

  • Stage(std::string name)
    Constructor. Initialize the given stage with the specified name. This name is used as both a key for reporting metrics, and a key for loading configuration from a config package.

  • ~Stage()
    Virtual destructor, for cleanup.

  • const std::string & name()
    Returns the name of this stage, previously configured at construction time.

  • void add_arguments(core::ArgumentParser & parser)
    Called before initialization, allows a stage to add custom command line options to the CLI. The resulting parsed arguments are made available to the stage through the StageInterface during initizilation.

  • void initialize(StageInterface & interface)
    Called on initialization, when a pipeline is first starting. A context is passed into the initialization routine, which allows you to register callbacks and timers.

  • void start()
    Indicates that the system has settled and you should begin any threads or processing. Note that the pipeline will be executing asynchronously with code in start().

  • void interrupt()
    Called when the system is ‘interrupted’ or requesting a shutdown. This will be invoked in the even that an executor is sent an interrupt request. You can use this signal to complete some outstanding work before the shutdown process fully begins. You will need to hold onto a shutdown token if you wish to delay shutdown to complete your work.

  • void shutdown()
    Called on shutdown, when the pipeline is finishing execution. All stages with threads should stop their threads at this point. The thread pool will continue to execute until all outstanding work is done.

  • void finalize()
    Called on shutdown, after the thread pool has become idle and no more work is present. This gives you a chance to finish out any outstanding work before your destructors are called.