Module turtle_publisher

The publisher is a helper for publishing messages on a channel.

Behaviours: gen_server.

Description

The publisher is a helper for publishing messages on a channel

Function Index

await/2await/2 waits for a publisher to come on-line or a timeout.
child_spec/4Provide a child spec for OTP supervisor linkage.
publish/6publish a message asynchronously to RabbitMQ.
publish_sync/6publish a message synchronously to RabbitMQ.
start_link/3Start a new publication worker.
start_link/4start_link/4 starts a publisher with options.
update_configuration/4
where/1where/1 returns what Pid a publisher is currently running under.

Function Details

await/2

await(N, Timeout) -> any()

await/2 waits for a publisher to come on-line or a timeout

child_spec/4

child_spec(Name, Conn, Decls, Options) -> any()

Provide a child spec for OTP supervisor linkage

The options are is as in start_link/4

publish/6

publish(Publisher, Exch, Key, ContentType, Payload, Opts) -> any()

publish a message asynchronously to RabbitMQ

The specification is that you have to provide all parameters, because experience has shown that you end up having to tweak these things quite a lot in practice. Hence we provide the full kind of messaging, rather than a subset.

publish_sync/6

publish_sync(Publisher, Exch, Key, ContentType, Payload, Opts) -> any()

publish a message synchronously to RabbitMQ

A synchronous publish means the caller is blocked until the message is on-the-wire toward the RabbitMQ server. It doesn't guarantee delivery, for which you must use publisher confirms. The options are as in publish/5

start_link/3

start_link(Name, Connection, Declarations) -> any()

Start a new publication worker

Provides an OTP gen_server for supervisor linkage. The Name is the name of this publisher (which it registers itself in gproc as). The Connection is the turtle-name for the connection, i.e., amqp_server. Finally, Declarations is a declaration list to be executed against AMQP when setting up.

start_link/4

start_link(Name, Connection, Declarations, InOptions) -> any()

start_link/4 starts a publisher with options

This variant of start_link takes an additional Options section which can be used to set certain publisher-specific options:
#{ confirms => true }
should be enable publisher confirms?
#{ passive => true }
Force queues and exchanges to be declared passively.

update_configuration/4

update_configuration(Name, Connection, Decls, InOpts) -> any()

where/1

where(N) -> any()

where/1 returns what Pid a publisher is currently running under


Generated by EDoc