NewConsumer Consumer's constructor
(q *Queue, opts ...ConsumerOpt)
| 96 | |
| 97 | // NewConsumer Consumer's constructor |
| 98 | func NewConsumer(q *Queue, opts ...ConsumerOpt) *Consumer { |
| 99 | c := &Consumer{ |
| 100 | q: q, |
| 101 | deliveries: make(chan amqp.Delivery), |
| 102 | errs: make(chan error, 100), |
| 103 | stop: make(chan struct{}), |
| 104 | } |
| 105 | for _, o := range opts { |
| 106 | o(c) |
| 107 | } |
| 108 | return c |
| 109 | } |
| 110 | |
| 111 | // Qos on channel |
| 112 | func Qos(count int) ConsumerOpt { |
no outgoing calls