Runbox.Runtime.Stage.TemplateCarrier (runbox v1.2.0)

Module implements producer_consumer GenStage behaviour, scenario template is used to handle events

Every scenario template is represented in stage based runtime by this module. TemplateCarrier uses Runbox.Runtime.Stage.UnitRegistry as its state (packed in Runbox.StateStore.Entity envelope for StateStore usage). UnitRegistry provides functionality to lookup units via subscriptions defined in scenario template.

If unit is located for given message, Toolbox.Scenario.Template.StageBased.handle_message/2 is used to handle this message. When there is no registered unit for given routing key, Toolbox.Scenario.Template.StageBased.handle_asset_discovery/1 is used instead.

The state is updated in Runbox.StateStore.Entity with Runbox.StateStore.Entity.update_state/3 after every message is processed. Additionally, before a message is processed it is confirmed that all messages with lower timestamps were processed. This is done with Runbox.StateStore.Entity.ack_processed_time/3 and can result in saving the state in state store.

Link to this section Summary

Link to this section Functions

Link to this function

component_name(template)

Link to this function

start_link(args, runbox_ctx, start_ctx)