View Source Skitter.Runtime (Skitter v0.7.1)

Skitter runtime system API.

This modules defines various functions which can be used to query the Skitter runtime system. Many of these functions are only useful to obtain additional information based on data returned by telemetry events.

Summary

Types

Reference to a deployed workflow.

Functions

Deploy a workflow over the cluster.

Get the workflow for a reference or context.

Get the current runtime mode.

Get the workflow node based on a context.

Get the name of the workflow node based on a context.

Get the reference based on a context.

Get a list with references to every spawned workflow.

Stop the workflow with reference ref.

Types

@type ref() :: reference()

Reference to a deployed workflow.

Functions

@spec deploy(Skitter.Workflow.t()) :: ref()

Deploy a workflow over the cluster.

Starts a Skitter application (i.e. a Skitter.Workflow.t/0) by deploying it over the cluster. The workflow is flattened (using Skitter.Workflow.flatten/1) before it is deployed. After deployment, this function returns a ref/0, which can be used by various functions in this module.

@spec get_workflow(ref() | Skitter.Strategy.context()) :: Skitter.Workflow.t()

Get the workflow for a reference or context.

The workflow will not have any in or out ports and only contain operation nodes, since deploy/1 flattens workflows before it deploys them.

@spec mode() :: :worker | :master | :local | :test

Get the current runtime mode.

This function returns the mode of the current runtime. The available modes and their goal are documented in the configuration documentation. This function may also return :test, which is only used for testing.

Link to this function

node_for_context(context)

View Source

Get the workflow node based on a context.

The workflow node will always be an operation node.

Link to this function

node_name_for_context(context)

View Source
@spec node_name_for_context(Skitter.Strategy.context()) :: Skitter.Workflow.name()

Get the name of the workflow node based on a context.

Link to this function

ref_for_context(context)

View Source
@spec ref_for_context(Skitter.Strategy.context()) :: ref()

Get the reference based on a context.

This can be used to link a telemetry event which contained a context to a deployed workflow.

@spec spawned_workflows() :: [ref()]

Get a list with references to every spawned workflow.

This function communicates with the master node when called from a worker runtime.

@spec stop(ref()) :: :ok

Stop the workflow with reference ref.