minato_sup (minato v0.18.6)

View Source

The supervisor over the pools.

Pools declared in the application environment are started here, so an application whose database is not up yet still starts: a pool is up before it has connections, and fills in the background.

{minato, [{pools, #{main => #{size => 10, connection => #{user => ~"minato"}}}},
          {listeners, #{events => #{connection => #{user => ~"minato"}}}}]}

start_pool/2 and start_listener/2 add one at run time. A pool is one_for_one and permanent: it holds sockets, and a pool that died and stayed dead would take every caller with it.

Summary

Functions

Start the supervisor and every pool the environment declares.

Add a listener at run time.

Add a pool at run time.

Stop a listener and forget it.

Stop a pool and forget it.

Functions

start_link()

-spec start_link() -> supervisor:startlink_ret().

Start the supervisor and every pool the environment declares.

start_listener(Name, Opts)

Add a listener at run time.

start_pool(Name, Opts)

Add a pool at run time.

stop_listener(Name)

-spec stop_listener(minato_listener:name()) -> ok | {error, not_found}.

Stop a listener and forget it.

stop_pool(Name)

-spec stop_pool(minato_pool:name()) -> ok | {error, not_found}.

Stop a pool and forget it.