func()

in internal/conn/conn.go [84:102]


func (s *Service) Send(notify models.Notifications) {
	if notify.DataCount() > 1000 {
		notify.SendPromise(models.ErrBatchSize, s.clientErrs)
		return
	}

	// Makes this predictable for testing, as select is non-deterministic.
	if notify.Ctx().Err() != nil {
		notify.SendPromise(notify.Ctx().Err(), s.clientErrs)
		return
	}

	select {
	case <-notify.Ctx().Done():
		notify.SendPromise(notify.Ctx().Err(), s.clientErrs)
	case s.in <- notify:
	}
	return
}