Module kyu_connection

This module is responsible for creating and maintaining amqp connections.

Behaviours: gen_server.

Description

This module is responsible for creating and maintaining amqp connections.

Data Types

name()

name() = term()

opts()

opts() = #{id := supervisor:child_id(), name := name(), url := iodata(), host := iolist(), port := integer(), username := binary(), password := binary(), heartbeat := integer(), virtual_host := binary(), channel_max := integer(), frame_max := integer(), ssl_options := term(), client_properties := list(), retry_sleep := integer(), max_attempts := infinity | integer(), management := #{host := iodata(), port := integer()}}

Function Index

apply/3Calls a function on the underlying amqp connection.
await/1Equivalent to kyu_connection:await(Name, 60000).
await/2Waits for the connection to successfully connect.
call/2Makes a gen_server:call/2 to the connection.
call/3Makes a gen_server:call/3 to the connection.
cast/2Makes a gen_server:cast/2 to the connection.
child_spec/1Returns a connection child spec.
network/1Returns the connection's network params.
option/2Equivalent to kyu_connection:option(Name, Key, undefined).
option/3Returns a value from the connection's options.
pid/1Returns the pid of the underlying amqp connection.
start_link/1Starts a connection.
status/1Returns the up atom if the process is running and has an active connection.
stop/1Gracefully closes the connection.
subscribe/1Subscribes the calling process to events from the connection.
where/1Returns the pid of the connection.

Function Details

apply/3

apply(Name::name(), Function::atom(), Args::list()) -> term()

Calls a function on the underlying amqp connection.

await/1

await(Name::name()) -> ok

Equivalent to kyu_connection:await(Name, 60000).

await/2

await(Name::name(), Timeout::timeout()) -> ok

Waits for the connection to successfully connect.

call/2

call(Name::name(), Request::term()) -> term()

Makes a gen_server:call/2 to the connection.

call/3

call(Name::name(), Request::term(), Timeout::timeout()) -> term()

Makes a gen_server:call/3 to the connection.

cast/2

cast(Name::name(), Request::term()) -> ok

Makes a gen_server:cast/2 to the connection.

child_spec/1

child_spec(Opts::opts()) -> supervisor:child_spec()

Returns a connection child spec.

network/1

network(Name::name()) -> #amqp_params_network{}

Returns the connection's network params.

option/2

option(Name::name(), Key::atom()) -> term()

Equivalent to kyu_connection:option(Name, Key, undefined).

option/3

option(Name::name(), Key::atom(), Value::term()) -> term()

Returns a value from the connection's options.

pid/1

pid(Name::name()) -> pid() | undefined

Returns the pid of the underlying amqp connection.

start_link/1

start_link(Opts::opts()) -> {ok, pid()} | {error, term()}

Starts a connection.

status/1

status(Name::name()) -> up | down

Returns the up atom if the process is running and has an active connection.

stop/1

stop(Name::name()) -> ok

Gracefully closes the connection.

subscribe/1

subscribe(Name::name()) -> ok

Subscribes the calling process to events from the connection.

where/1

where(Name) -> any()

Returns the pid of the connection. -spec where(Name :: name()) -> pid() | undefined.


Generated by EDoc