View Source Hyperliquid.Streamer.Supervisor (hyperliquid v0.1.1)
Supervisor for WebSocket stream processes in the Hyperliquid application.
This module implements a dynamic supervisor that manages WebSocket stream processes. It allows for dynamically starting and stopping stream processes, providing flexibility in managing multiple WebSocket connections.
Key Features
- Dynamically supervises WebSocket stream processes
- Provides functions to start and stop individual stream processes
- Allows querying of currently supervised children
Usage
This supervisor is typically started as part of your application's supervision tree. It can then be used to dynamically manage WebSocket stream processes.
Example:
# Start the supervisor
{:ok, pid} = Hyperliquid.Streamer.Supervisor.start_link()
# Start a new stream process
{:ok, stream_pid} = Hyperliquid.Streamer.Supervisor.start_stream([%{type: "allMids"}])
# Stop a stream process
:ok = Hyperliquid.Streamer.Supervisor.stop_child(stream_pid)
Note: This supervisor uses a :one_for_one strategy, meaning each child is supervised independently.
Summary
Functions
Returns a specification to start this module under a supervisor.
Callback implementation for DynamicSupervisor.init/1
.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Callback implementation for DynamicSupervisor.init/1
.