View Source Run Strategies

Tasks can be executed via different run strategies.

configuration

Configuration

mix

Mix

config :my_app, MyApp.Scheduler,
  jobs: [
    [schedule: "* * * * *", run_strategy: {StrategyName, options}],
  ]

The run strategy can be configured by providing a tuple of the strategy module name and it's options. If you choose Local Node strategy, the config should be:

config :my_app, MyApp.Scheduler,
  jobs: [
    [schedule: "* * * * *", run_strategy: Quantum.RunStrategy.Local],
  ]

runtime

Runtime

Provide a value that implements the Quantum.RunStrategy.NodeList protocol. The value will not be normalized.

provided-strategies

Provided Strategies

all-nodes

All Nodes

Quantum.RunStrategy.All

If you want to run a task on all nodes of either a list or in the whole cluster, use this strategy.

random-node

Random Node

Quantum.RunStrategy.Random

If you want to run a task on any node of either a list or in the whole cluster, use this strategy.

local-node

Local Node

Quantum.RunStrategy.Local

If you want to run a task on local node, use this strategy.

custom-run-strategy

Custom Run Strategy

Custom run strategies, can be implemented by implementing the Quantum.RunStrategy behaviour and the Quantum.RunStrategy.NodeList protocol.