Module kyu_publisher

This module is responsible for creating and managing amqp publishers.

Behaviours: gen_server.

Description

This module is responsible for creating and managing amqp publishers.

Data Types

execution()

execution() = sync | async | supervised

name()

name() = term()

opts()

opts() = #{id := supervisor:child_id(), name := name(), channel := kyu_channel:name(), confirms := boolean()}

Function Index

await/1Equivalent to kyu_publisher:await(Name, 60000).
await/2Waits for the publisher to successfully setup.
call/2Makes a gen_server:call/2 to the publisher.
call/3Makes a gen_server:call/3 to the publisher.
cast/2Makes a gen_server:cast/2 to the publisher.
channel/1Returns the name of the publisher's channel.
child_spec/2Returns a publisher child spec.
connection/1Returns the name of the publisher's connection.
option/3Returns a value from the publisher's options.
publish/2Publishes a message on the channel.
start_link/2Starts a publisher.
status/1Returns the up atom if the publisher is running and has an active channel.
stop/1Gracefully stops the publisher.
where/1Returns the pid of the publisher.

Function Details

await/1

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

Equivalent to kyu_publisher:await(Name, 60000).

await/2

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

Waits for the publisher to successfully setup.

call/2

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

Makes a gen_server:call/2 to the publisher.

call/3

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

Makes a gen_server:call/3 to the publisher.

cast/2

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

Makes a gen_server:cast/2 to the publisher.

channel/1

channel(Name::name()) -> kyu_channel:name()

Returns the name of the publisher's channel.

child_spec/2

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

Returns a publisher child spec.

connection/1

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

Returns the name of the publisher's connection.

option/3

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

Returns a value from the publisher's options.

publish/2

publish(Name::name(), Message::kyu:message()) -> ok | {error, binary()}

Publishes a message on the channel.

start_link/2

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

Starts a publisher.

status/1

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

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

stop/1

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

Gracefully stops the publisher.

where/1

where(Name) -> any()

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


Generated by EDoc