Forex.Supervisor (Forex v0.2.1)

View Source

Supervisor for the Forex supervision tree.

The Forex.Supervisor module is responsible for supervising the Forex.Fetcher process, .ie., starting, stopping, and restarting the process.

The Forex.Supervisor accepts the following options:

  • auto_start - A boolean value that determines if the fetcher process should be started automatically when the supervisor is started. The default value is true.

  • use_cache - A boolean value that determines if the cache should be used. The default value is true.

Summary

Functions

Returns a specification to start this module under a supervisor.

Delete the Forex exchange rate fetcher process from the supervisor.

Check if the Forex exchange rate fetcher process has been initiated.

Check if the Forex exchange rate fetcher process is running.

Get the status of the Forex exchange rate fetcher process. If the process is running, it returns :running, if it has been initiated but not running, it returns :stopped, otherwise, it returns :not_started.

Restart the stoped Forex exchange rate fetcher process.

Start the Forex exchange rate fetcher process.

Stop the Forex exchange rate fetcher process.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

delete_fetcher()

Delete the Forex exchange rate fetcher process from the supervisor.

fetcher_initiated?()

Check if the Forex exchange rate fetcher process has been initiated.

fetcher_running?()

Check if the Forex exchange rate fetcher process is running.

fetcher_status()

Get the status of the Forex exchange rate fetcher process. If the process is running, it returns :running, if it has been initiated but not running, it returns :stopped, otherwise, it returns :not_started.

options(opts \\ [])

restart_fetcher()

Restart the stoped Forex exchange rate fetcher process.

start_fetcher(opts \\ Fetcher.options())

Start the Forex exchange rate fetcher process.

stop_fetcher()

Stop the Forex exchange rate fetcher process.