@@ -72,12 +72,14 @@ func (c *Client) deletePublisher(pub *Publisher) {
7272 delete (c .publishers , pub )
7373}
7474
75- // Errors returns AMQP connection level errors
75+ // Errors returns AMQP connection level errors. Default buffer size is 100.
76+ // Messages will be dropped in case if receiver can't keep up
7677func (c * Client ) Errors () <- chan error {
7778 return c .errs
7879}
7980
80- // Blocking notifies the server's TCP flow control of the Connection
81+ // Blocking notifies the server's TCP flow control of the Connection. Default
82+ // buffer size is 10. Messages will be dropped in case if receiver can't keep up
8183func (c * Client ) Blocking () <- chan amqp.Blocking {
8284 return c .blocking
8385}
@@ -231,9 +233,29 @@ func URL(addr string) ClientOpt {
231233 }
232234}
233235
234- // Backoff is a functional option, used to define backoff policy
236+ // Backoff is a functional option, used to define backoff policy, used in
237+ // `NewClient` constructor
235238func Backoff (bo Backoffer ) ClientOpt {
236239 return func (c * Client ) {
237240 c .bo = bo
238241 }
239242}
243+
244+ // ErrorsChan is a functional option, used to initialize error reporting channel
245+ // in client code, maintaining control over buffer size. Default buffer size is
246+ // 100. Messages will be dropped in case if receiver can't keep up, used in
247+ // `NewClient` constructor
248+ func ErrorsChan (errChan chan error ) ClientOpt {
249+ return func (c * Client ) {
250+ c .errs = errChan
251+ }
252+ }
253+
254+ // BlockingChan is a functional option, used to initialize blocking reporting
255+ // channel in client code, maintaining control over buffering, used in
256+ // `NewClient` constructor
257+ func BlockingChan (blockingChan chan amqp.Blocking ) ClientOpt {
258+ return func (c * Client ) {
259+ c .blocking = blockingChan
260+ }
261+ }
0 commit comments