atomic
(conn amqpConnection, name string, opts *SubscriptionOptions)
| 598 | var nextConsumer int64 // atomic |
| 599 | |
| 600 | func newSubscription(conn amqpConnection, name string, opts *SubscriptionOptions) *subscription { |
| 601 | if opts == nil { |
| 602 | opts = &SubscriptionOptions{} |
| 603 | } |
| 604 | |
| 605 | return &subscription{ |
| 606 | conn: conn, |
| 607 | queue: name, |
| 608 | consumer: fmt.Sprintf("c%d", atomic.AddInt64(&nextConsumer, 1)), |
| 609 | opts: opts, |
| 610 | receiveBatchHook: func() {}, |
| 611 | } |
| 612 | } |
| 613 | |
| 614 | // Must be called with s.mu held. |
| 615 | func (s *subscription) establishChannel(ctx context.Context) error { |
no outgoing calls