Skip to content

Commit

Permalink
Forward execution options from engine.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed Mar 26, 2024
1 parent 16e21b9 commit 6b9d8fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ func New(app dogma.Application, options ...EngineOption) *Engine {
//
// It may be called without calling [Engine.Run]. In this mode of operation, the
// engine acts solely as a router that forwards messages to worker nodes.
func (e *Engine) ExecuteCommand(ctx context.Context, c dogma.Command) error {
func (e *Engine) ExecuteCommand(
ctx context.Context,
c dogma.Command,
options ...dogma.ExecuteCommandOption,
) error {
if c == nil {
panic("command must not be nil")
}
Expand All @@ -45,7 +49,7 @@ func (e *Engine) ExecuteCommand(ctx context.Context, c dogma.Command) error {
panic(fmt.Sprintf("command is unrecognized: %T", c))
}

return x.ExecuteCommand(ctx, c)
return x.ExecuteCommand(ctx, c, options...)
}

// Run joins the cluster as a worker that handles the application's messages.
Expand Down

0 comments on commit 6b9d8fc

Please sign in to comment.