Stargate.Supervisor (stargate v0.2.0) View Source

This module defines a top-level supervisor for your Stargate client. It takes a keyword list of configuration values for connecting to the cluster and any producers, readers, or consumers desired, and orchestrates the starting of the process registry and the websocket client(s).

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Creates a Stargate Supervisor and links it to the current process. Pass a keyword list of connection and client information to define the types of websocket connection to establish with the Pulsar cluster.

Convenience function for working with the Stargate process registry.

Link to this section Types

Specs

process_key() :: {atom(), String.t(), String.t(), String.t(), String.t()}

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

start_link(keyword()) :: GenServer.on_start()

Creates a Stargate Supervisor and links it to the current process. Pass a keyword list of connection and client information to define the types of websocket connection to establish with the Pulsar cluster.

Example

opts = [
    host: [{"broker-url.com", 8080}]
    producer: [
        ... producer configs ...
    ],
    consumer: [
        ... consumer configs ...
    ]
]

See the Stargate.Producer and Stargate.Receiver modules for the full list of configuration options to each type of client connection.

Specs

via(atom(), process_key()) :: {:via, atom(), {atom(), process_key()}}

Convenience function for working with the Stargate process registry.