View Source SuperWorker.Supervisor.ConfigWrapper (SuperWorker v0.0.7)

This module is a wrapper for the configuration of the supervisor.

Summary

Functions

Load the configuration of the supervisor with the given configuration.

Load the configuration of the supervisor.

Load one supervisor with the given configuration.

Functions

load()

@spec load() :: :ok

Load the configuration of the supervisor with the given configuration.

Config has path 'config :super_worker,...'

Examples

config :super_worker,
  options: :hello,
  sup_cfg_1: [  # Declare config by config file.
    options: [
      number_of_partitions: 2,
      link: true,
      report_to: {Dev, :report, []}
    ],
    groups: [
      group1: [
        options: [
          restart_strategy: :one_for_all
        ],
        workers: [
          worker1: [
            task: {Dev, :task, [15]}
          ],
          worker2: [
            options: [

            ],
            task: {Dev, :task_crash, [15, 5]}
          ]
        ]
      ],
    ]
  ]

load(opts)

Load the configuration of the supervisor.

load_one(sup_config)

@spec load_one(atom()) :: {:error, any()} | {:ok, pid()}

Load one supervisor with the given configuration.