From 6b9d8fc85de55c42bcec006a5edcb565ef4861a4 Mon Sep 17 00:00:00 2001 From: James Harris Date: Tue, 26 Mar 2024 11:37:37 +1000 Subject: [PATCH] Forward execution options from engine. --- engine.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engine.go b/engine.go index 681604f2..05fd2e96 100644 --- a/engine.go +++ b/engine.go @@ -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") } @@ -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.