MCPcopy Create free account
hub / github.com/google/go-cloud / newSubscription

Function newSubscription

pubsub/rabbitpubsub/rabbit.go:600–612  ·  view source on GitHub ↗

atomic

(conn amqpConnection, name string, opts *SubscriptionOptions)

Source from the content-addressed store, hash-verified

598var nextConsumer int64 // atomic
599
600func 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.
615func (s *subscription) establishChannel(ctx context.Context) error {

Callers 3

CreateSubscriptionMethod · 0.70
OpenSubscriptionFunction · 0.70

Calls

no outgoing calls

Tested by 2

CreateSubscriptionMethod · 0.56