Module kyu_channel

This module is responsible for creating and maintaining amqp channels.

Behaviours: gen_server.

Description

This module is responsible for creating and maintaining amqp channels.

Data Types

name()

name() = term()

opts()

opts() = #{id := supervisor:child_id(), name := name()}

Function Index

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

Function Details

apply/3

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

Calls a function on the underlying amqp channel.

await/1

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

Equivalent to kyu_channel:await(Name, 60000).

await/2

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

Waits for the channel to successfully setup.

call/2

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

Makes a gen_server:call/2 to the channel.

call/3

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

Makes a gen_server:call/3 to the channel.

cast/2

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

Makes a gen_server:cast/2 to the channel.

child_spec/2

child_spec(Connection::kyu_connection:name(), Opts::opts()) -> supervisor:child_spec()

Returns a channel child spec.

connection/1

connection(Name::name()) -> kyu_connection:name()

Returns the name of the channel's connection.

option/2

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

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

option/3

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

Returns a value from the channel's options.

pid/1

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

Returns the pid of the underlying amqp channel.

start_link/2

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

Starts a channel.

status/1

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

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

stop/1

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

Gracefully closes the channel.

subscribe/1

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

Subscribes the calling process to events from the channel.

where/1

where(Name) -> any()

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


Generated by EDoc