antikythera v0.4.0 Antikythera.Mix.Task View Source

Helper functions for making mix tasks in gears.

Functions in this module can only be used in mix tasks.

Link to this section Summary

Functions

Starts the current antikythera instance and its dependency applications without web server functionality.

Set the specified node_id to the Antikythera.ContextId in GearLog.

Link to this section Functions

Link to this function

prepare_antikythera_instance()

View Source

Specs

prepare_antikythera_instance() :: :ok

Starts the current antikythera instance and its dependency applications without web server functionality.

If you need web server functionality in your mix task, use Application.ensure_all_started(Antikythera.Env.antikythera_instance_name()).

Link to this function

set_node_id_to_gear_log_context(node_id)

View Source

Specs

set_node_id_to_gear_log_context(Antikythera.NodeId.t()) :: :ok

Set the specified node_id to the Antikythera.ContextId in GearLog.

If you want to use GearLog in mix task, you must set node_id before you call GearLog functions.

The Antikythera.ContextId in GearLog will become {timestamp}_{node_id}_{PID}. The timestamp and PID are automatically got from system.