PhoenixMicro.Transport.ConnectionSupervisor (PhoenixMicro v1.0.0)

Copy Markdown View Source

A Supervisor that owns a single transport's connection process and its associated worker pool.

One ConnectionSupervisor is started per configured transport:

TransportSupervisor (one_for_one root)
 ConnectionSupervisor(:rabbitmq)    this module
       Transport.RabbitMQ            connection GenServer
       WorkerPool(:rabbitmq_pool)    message processing pool

The :rest_for_one strategy means: if the connection dies, the worker pool is restarted too (workers hold references to the connection channel). If only the pool dies, the connection is left intact.

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns the worker pool name for a given transport.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

pool_name(transport_name)

@spec pool_name(atom()) :: atom()

Returns the worker pool name for a given transport.

start_link(opts)

@spec start_link(keyword()) :: Supervisor.on_start()