Forex.Fetcher.Supervisor (Forex v1.1.2)

Copy Markdown View Source

Supervisor for the Forex.Fetcher module that fetches exchange rates.

The Supervisor provides functionality to start, stop and restarting the Forex.Fetcher.

The Forex.Fetcher.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(supervisor \\ __MODULE__)

Delete the Forex exchange rate fetcher process from the supervisor.

fetcher_initiated?(supervisor \\ __MODULE__)

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

fetcher_running?(supervisor \\ __MODULE__)

Check if the Forex exchange rate fetcher process is running.

fetcher_status(supervisor \\ __MODULE__)

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_fetcher(supervisor \\ __MODULE__)

Restart the stoped Forex exchange rate fetcher process.

start_fetcher(opts_or_supervisor \\ __MODULE__)

Start the Forex exchange rate fetcher process.

start_fetcher(supervisor, opts)

start_link(opts)

Starts the Forex.Fetcher.Supervisor process.

This function should be called in your application supervision tree to start the Forex exchange rate fetcher.

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.

  • name - The name to register the supervisor process under. Defaults to Forex.Fetcher.Supervisor.

stop_fetcher(supervisor \\ __MODULE__)

Stop the Forex exchange rate fetcher process.