Runbox.Runtime.ComponentNetwork behaviour (runbox v26.0.0)

View Source

Component network builds and validates run component dependency network.

To build this network, module uses dependencies defined by the scenario.

Summary

Functions

Creates base network with only template nodes

Main function. Given list of template modules, expands them into components network with input streams, timezips etc...

Return all input topic names that are being subscribed to in component network.

Types

component()

@type component() :: any()

t()

@type t() :: any()

Callbacks

convert_to_network(list)

@callback convert_to_network([Runbox.ScenarioTemplate.t()]) :: t()

create(list, t)

@callback create([Runbox.ScenarioTemplate.t()], Keyword.t()) ::
  {:ok, t()} | {:error, term()}

input_topics(t)

@callback input_topics(t()) :: [String.t()]

Functions

convert_to_network(scenario_type, scenario_templates)

@spec convert_to_network(Runbox.Scenario.Type.t(), [Runbox.ScenarioTemplate.t()]) ::
  t()

Creates base network with only template nodes

create(scenario_type, scenario_templates, opts \\ [])

@spec create(Runbox.Scenario.Type.t(), [Runbox.ScenarioTemplate.t()], Keyword.t()) ::
  {:ok, t()} | {:error, term()}

Main function. Given list of template modules, expands them into components network with input streams, timezips etc...

Options

  • :direct_ticking - if true (default), creates network using direct ticking

input_topics(scenario_type, component_network)

@spec input_topics(Runbox.Scenario.Type.t(), t()) :: [String.t()]

Return all input topic names that are being subscribed to in component network.

topology_sort(binary, network)

@spec topology_sort(Runbox.Scenario.Type.t(), t()) :: [component()]