コード例 #1
0
ファイル: broker.go プロジェクト: ChugR/qpid-proton
// receiver receives messages and pushes to a queue.
func (c *connection) receiver(receiver electron.Receiver) {
	q := c.broker.queues.Get(receiver.Target())
	for {
		if rm, err := receiver.Receive(); err == nil {
			util.Debugf("%v: received %v", receiver, util.FormatMessage(rm.Message))
			q <- rm.Message
			rm.Accept()
		} else {
			util.Debugf("%v error: %v", receiver, err)
			break
		}
	}
}
コード例 #2
0
ファイル: broker.go プロジェクト: b-cuts/qpid-proton
// receiver receives messages and pushes to a queue.
func (b *broker) receiver(receiver electron.Receiver) {
	q := b.queues.Get(receiver.Target())
	for {
		if rm, err := receiver.Receive(); err == nil {
			util.Debugf("%s: received %s", receiver, util.FormatMessage(rm.Message))
			q <- rm.Message
			rm.Accept()
		} else {
			util.Debugf("%s error: %s", receiver, err)
			break
		}
	}
}