Enhance Event Emitter to ignore events generated by same process ID #2279
Labels
enhancement
New feature or request
priority-medium
Not functioning - next quarter if capacity permits
Is your feature or enhancement request related to a problem or limitation? Please describe
As a developer of a Zowe app like Zowe Explorer that uses the Imperative event emitter, I register the
ON_VAULT_CHANGED
event because I want to know when an external app has updated credentials. The event also fires when my own app has updated credentials, which is not ideal as it may result in a duplicate refresh operation (e.g. the "Update Credentials" dialog shows twice).Describe your enhancement idea
Add an
ignoreSameProcess
option when registering to watch for an event, which checks the PID (process ID) of the event and prevents events from being emitted to the same app that triggered them.Describe alternatives you've considered
An alternative workaround is for apps like ZE to modify the
EventProcessor
prototype to skip duplicate events, but this is kind of hacky:Provide any additional context
Related to this Zowe Explorer PR: zowe/zowe-explorer-vscode#3157
The text was updated successfully, but these errors were encountered: