MCPcopy Create free account
hub / github.com/assembla/cony / NewPublisher

Function NewPublisher

publisher.go:120–131  ·  view source on GitHub ↗

NewPublisher is a Publisher constructor

(exchange string, key string, opts ...PublisherOpt)

Source from the content-addressed store, hash-verified

118
119// NewPublisher is a Publisher constructor
120func NewPublisher(exchange string, key string, opts ...PublisherOpt) *Publisher {
121 p := &Publisher{
122 exchange: exchange,
123 key: key,
124 pubChan: make(chan publishMaybeErr),
125 stop: make(chan struct{}),
126 }
127 for _, o := range opts {
128 o(p)
129 }
130 return p
131}
132
133// PublishingTemplate Publisher's functional option. Provide template
134// amqp.Publishing and save typing.

Callers 2

TestNewPublisherFunction · 0.85
newTestPublisherFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestNewPublisherFunction · 0.68
newTestPublisherFunction · 0.68