amqp

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL