Closed bounoable closed 1 year ago
Add options to enable concurrent command handling.
package example func example(bus command.Bus) { h := command.NewHandler(bus) h.Handle(context.TODO(), "foo", func(ctx command.Context) error { ... }, command.Workers(4)) }
package example type Foo struct { *aggregate.Base *handler.BaseHandler } func NewFoo(id uuid.UUID) *Foo { ... } func example(bus command.Bus, repo aggregate.Repository) { h := handler.New(NewFoo, repo, bus) h.Handle(context.TODO(), command.Workers(4)) }
Not needed until now..
Add options to enable concurrent command handling.
Standalone command handler
Aggregate-based command handler