-
Notifications
You must be signed in to change notification settings - Fork 407
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
fix: add eventEmitter on libraryCommand #5768
base: develop
Are you sure you want to change the base?
Conversation
@@ -220,13 +224,15 @@ export abstract class LibraryCommandletExecutor<T> | |||
properties, | |||
measurements | |||
); | |||
LibraryCommandletExecutor.libraryCommandCompletionEventEmitter.fire(!!success); |
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.
Not sure if it is meaningful. LibraryCommandletExecutor is an abstract class to be extended by other real executors such as orgLogoutDefault
or orgLoginAccessToken
. How does the subscriber know the result from which command it is listening to with only a boolean value? Can you help me understand that? @angelamuliu @peternhale
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.
Great catch @mingxuanzhangsfdx, there is no way to know. If two commands are run concurrently and are listening for the completion event, knowing which event belongs any given listener is indeterminant.
@@ -220,13 +224,15 @@ export abstract class LibraryCommandletExecutor<T> | |||
properties, | |||
measurements | |||
); | |||
LibraryCommandletExecutor.libraryCommandCompletionEventEmitter.fire(!!success); |
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.
Great catch @mingxuanzhangsfdx, there is no way to know. If two commands are run concurrently and are listening for the completion event, knowing which event belongs any given listener is indeterminant.
@angelamuliu This PR cannot move forward due to concurrency issues. |
What does this PR do?
Adds event emitter "onLibraryCommandCompletion" (accessible via CommandEventDispatcher) that fires a boolean regarding whether a library command succeeded or failed.
What issues does this PR fix or reference?
@W-16420054@
Functionality Before
Before there was no way of knowing if a library command (such as deploy) succeeded or failed.
Functionality After
Consumer can subscribe to onLibraryCommandCompletion event and understand whether command succeeded or failed.