View Source ExTwelveData.Supervisor (ExTwelveData v0.4.0)

Supervisor for the RealTimePrices and SubscriptionsManager processes.

It starts the RealTimePrices and SubscriptionsManager processes, and restarts them if they crash. This is important since the RealTimePrices client has an implicit state with the Twelve Data connection: the list of symbols that are subscribed to is determined by the sequence of subscribe/unsubscribe messages. If the RealTimePrices process crashes, the state is lost, and the list of subscribed symbols is reset. This supervisor ensures that when the RealTimePrices process crashes, it is restarted with a fresh SubscriptionManager process, which will then have a clean state, and restart the entire flow.

Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for Supervisor.init/1.

Types

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Callback implementation for Supervisor.init/1.

@spec start_link(options()) :: {:error, any()} | {:ok, pid()}