-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/181 asynchronous return execution #183
Feature/181 asynchronous return execution #183
Conversation
@@ -34,7 +34,7 @@ type ExecutionDetails struct { | |||
} | |||
|
|||
type IDecomposer interface { | |||
Execute(playbook cacao.Playbook) (*ExecutionDetails, error) | |||
Execute(playbook cacao.Playbook, details chan ExecutionDetails) (*ExecutionDetails, error) | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need a new interface to leave this one as is ExecuteAsync and Execute so the Playbook action step can be untouched.
internal/decomposer/decomposer.go
Outdated
@@ -69,11 +69,18 @@ type Decomposer struct { | |||
} | |||
|
|||
// Execute a Playbook | |||
func (decomposer *Decomposer) Execute(playbook cacao.Playbook) (*ExecutionDetails, error) { | |||
func (decomposer *Decomposer) Execute(playbook cacao.Playbook, execution_details_ch chan ExecutionDetails) (*ExecutionDetails, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Exection details can be moved into two different functions and the rest of the execution can be doen in execute(..)
Added asynchronous logic to return execution details as soon as available