Documentation ¶
Index ¶
- func NewAMQPEventEmitter(conn *amqp.Connection, exchange string) (msgqueue.EventEmitter, error)
- func NewAMQPEventEmitterFromEnvironment() (msgqueue.EventEmitter, error)
- func NewAMQPEventListener(conn *amqp.Connection, exchange string, queue string) (msgqueue.EventListener, error)
- func NewAMQPEventListenerFromEnvironment() (msgqueue.EventListener, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAMQPEventEmitter ¶
func NewAMQPEventEmitter(conn *amqp.Connection, exchange string) (msgqueue.EventEmitter, error)
NewAMQPEventEmitter creates a new event emitter. It will need an AMQP connection passed as parameter and use this connection to create its own channel (note: AMQP channels are not thread-safe, so just accepting the connection as a parameter and then creating our own private channel is the safest way to ensure this).
func NewAMQPEventEmitterFromEnvironment ¶
func NewAMQPEventEmitterFromEnvironment() (msgqueue.EventEmitter, error)
NewAMQPEventEmitterFromEnvironment will create a new event emitter from the configured environment variables. Important variables are:
- AMQP_URL; the URL of the AMQP broker to connect to
- AMQP_EXCHANGE; the name of the exchange to bind to
For missing environment variables, this function will assume sane defaults.
func NewAMQPEventListener ¶
func NewAMQPEventListener(conn *amqp.Connection, exchange string, queue string) (msgqueue.EventListener, error)
NewAMQPEventListener creates a new event listener. It will need an AMQP connection passed as parameter and use this connection to create its own channel (note: AMQP channels are not thread-safe, so just accepting the connection as a parameter and then creating our own private channel is the safest way to ensure this).
func NewAMQPEventListenerFromEnvironment ¶
func NewAMQPEventListenerFromEnvironment() (msgqueue.EventListener, error)
NewAMQPEventListenerFromEnvironment will create a new event listener from the configured environment variables. Important variables are:
- AMQP_URL; the URL of the AMQP broker to connect to
- AMQP_EXCHANGE; the name of the exchange to bind to
- AMQP_QUEUE; the name of the queue to bind and subscribe
For missing environment variables, this function will assume sane defaults.
Types ¶
This section is empty.