amqp

package
v0.0.0-...-490b4b6 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2015 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Amqp

type Amqp struct {

	// A mutex protecting dial attempts.
	sync.Mutex
	// contains filtered or unexported fields
}
var Adapter *Amqp = &Amqp{
	endpoint:      "localhost:55672",
	logger:        log.New(ioutil.Discard, "", log.LstdFlags),
	dialPolicy:    dial.ExpBackoff(10, time.Millisecond),
	closeNotifier: adapters.NewNotifier(),
}

Adapter is a singleton instance of a amqp service

func (*Amqp) Close

func (s *Amqp) Close()

Disconnect.

func (*Amqp) Config

func (s *Amqp) Config(params map[string]string) error

Set the service configuration. Changing the configuration settings for an already connected service will trigger a service shutdown. The service consumer is responsible for handing service close events and triggering a re-dial.

func (*Amqp) Dial

func (s *Amqp) Dial() error

Connect to the service. If a dial policy has been specified, the service will keep trying to reconnect until a connection is established or the dial policy aborts the reconnection attempt.

func (*Amqp) NewChannel

func (s *Amqp) NewChannel() (*amqpDriver.Channel, error)

Allocate new amqp channel.

func (*Amqp) NotifyClose

func (s *Amqp) NotifyClose(c adapters.CloseListener)

Register a listener for receiving close notifications. The service adapter will emit an error and close the channel if the service is cleanly shut down or close the channel if the connection is reset.

func (*Amqp) SetDialPolicy

func (s *Amqp) SetDialPolicy(policy dial.Policy)

Set a dial policy for this service.

func (*Amqp) SetLogger

func (s *Amqp) SetLogger(logger *log.Logger)

Register a logger instance for service events.

func (*Amqp) SetOptions

func (s *Amqp) SetOptions(opts ...adapters.ServiceOption) error

Apply a list of options to the service.

Jump to

Keyboard shortcuts

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