func New()

in internal/routing/routing.go [64:82]


func New(ctx context.Context, input chan batching.Batches, options ...Option) (*Batches, error) {
	if input == nil {
		return nil, errors.New("routing.New: input channel cannot be nil")
	}

	b := &Batches{
		input:  input,
		routes: routes{},
		log:    slog.Default(),
	}

	for _, o := range options {
		if err := o(b); err != nil {
			return nil, err
		}
	}

	return b, nil
}