You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue stems from much of the discussion on #619
There are a few items we felt needed to be addressed in a follow up PR, and tracked on this issue:
The apb pkg should expose the suite of actions (provision, depro etc.) with async and and sync variants. The async variants are expected to be non-blocking, and will return a channel for event-driven updates. It is the caller's responsibility to monitor this channel for status. The async variant is a recommended best practice. Alternatively, sync variants should also be available. These will block, and callers should assume the APBs have run to completion and the method should return the result of the execution.
The separation of Sync/Async jobs should be reverted. The WorkEngine is for asynchronous work, and there is little value for a sync job with status updates.
The text was updated successfully, but these errors were encountered:
Sounds reasonable. If we get the async API right, I think it'll be easy to add a blocking function in front of it that just watches the channel. Something more-or-less like this:
for {
report := <- reportChan
if report.State == "failed" {
return nil, errors.New("oops it failed")
} else if report.State == "success" {
return report.Result, nil
}
}
This issue stems from much of the discussion on #619
There are a few items we felt needed to be addressed in a follow up PR, and tracked on this issue:
The apb pkg should expose the suite of actions (provision, depro etc.) with async and and sync variants. The async variants are expected to be non-blocking, and will return a channel for event-driven updates. It is the caller's responsibility to monitor this channel for status. The async variant is a recommended best practice. Alternatively, sync variants should also be available. These will block, and callers should assume the APBs have run to completion and the method should return the result of the execution.
The separation of
Sync/Async
jobs should be reverted. TheWorkEngine
is for asynchronous work, and there is little value for a sync job with status updates.The text was updated successfully, but these errors were encountered: