in client/client.go [450:475]
func (a *ARN) Notify(ctx context.Context, n models.Notifications) error {
x := n.DataCount()
switch {
case x == 0:
return nil
case x > maxvals.NotificationItems:
return models.ErrBatchSize
}
n = n.SetCtx(ctx)
n = n.SetPromise(conn.PromisePool.Get().(chan error))
defer n.Recycle()
modelmetrics.ActivePromise(context.Background())
if ctx.Err() != nil {
return ctx.Err()
}
select {
case <-ctx.Done():
return ctx.Err()
case a.in <- n:
}
return n.Promise(context.Background())
}