Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AMQPSession ¶
type AMQPSession struct {
// contains filtered or unexported fields
}
func NewAMQPSession ¶
func NewAMQPSession(addr string) (*AMQPSession, error)
NewAMQPSession creates a new consumer state instance, and automatically attempts to connect to the server.
func (*AMQPSession) Close ¶
func (session *AMQPSession) Close(qName string) error
Close will delete the queue, close the channel and the connection.
func (*AMQPSession) Push ¶
func (session *AMQPSession) Push(ex, rt string, data []byte) error
Push will push data onto the queue, and wait for a confirm. If no confirms are received until within the resendTimeout, it continuously re-sends messages until a confirm is received. This will block until the server sends a confirm. Errors are only returned if the push action itself fails, see UnsafePush.
func (*AMQPSession) Stream ¶
func (session *AMQPSession) Stream(exName, qName, rKey string, consumer func(amqp.Delivery)) error
Stream will continuously put queue items on the channel. It is required to call delivery.Ack when it has been successfully processed, or delivery.Nack when it fails. Ignoring this will cause data to build up on the server.
func (*AMQPSession) UnsafePush ¶
func (session *AMQPSession) UnsafePush(ex, rt string, data []byte) error
Push will push to the queue without checking for confirmation. It returns an error if it fails to connect. No guarantees are provided for whether the server will recieve the message.