-
Notifications
You must be signed in to change notification settings - Fork 85
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
Event Operator and Processor #2136
Conversation
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
… a WIP of first iteration idea change Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
…sses to index for exporting Signed-off-by: Amber Torrise <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #2136 +/- ##
==========================================
- Coverage 91.22% 91.08% -0.14%
==========================================
Files 629 632 +3
Lines 17964 18007 +43
Branches 3831 3802 -29
==========================================
+ Hits 16387 16402 +15
- Misses 1576 1604 +28
Partials 1 1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: zFernand0 <[email protected]>
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 know I'm not allowed to approve this PR, but FWIW...
LGTM! 😋
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
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.
Thanks for your work on this @ATorrise and @zFernand0! I left a few comments, some for my own edification. It looks like there are some functions across the new Event classes that would benefit from adding @throws
. I also had a question regarding the subscribe...
function implementations.
packages/imperative/src/config/__tests__/Config.secure.unit.test.ts
Outdated
Show resolved
Hide resolved
packages/imperative/src/imperative/__tests__/config/cmd/init/init.handler.unit.test.ts
Outdated
Show resolved
Hide resolved
packages/imperative/src/imperative/__tests__/config/cmd/secure/secure.handler.unit.test.ts
Outdated
Show resolved
Hide resolved
packages/imperative/src/imperative/__tests__/config/cmd/set/set.handler.unit.test.ts
Outdated
Show resolved
Hide resolved
packages/imperative/src/security/__tests__/.events/Zowe/onCredentialManagerChanged
Outdated
Show resolved
Hide resolved
Signed-off-by: Amber Torrise <[email protected]>
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.
Trae had some comments worth considering.
However, I have nothing else to add, so I am approving.
Signed-off-by: zFernand0 <[email protected]>
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 believe all comments should be addressed in a4e268a
Thanks for the reviews.
We should have a short demo ready for later this week 😋
Signed-off-by: zFernand0 <[email protected]>
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.
LGTM - thanks @ATorrise @zFernand0 !
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.
LGTM, just one comment about potentially redundant code
…tsPt2 Signed-off-by: zFernand0 <[email protected]>
Here is something worth checking, besides the few integration tests that are failing here: The above is a workflow that shows a few tests where the |
Signed-off-by: zFernand0 <[email protected]>
Quality Gate passedIssues Measures |
Release succeeded for the The following packages have been published:
Powered by Octorelease 🚀 |
Overview
The
EventOperator
class is a singleton controller for managingEventProcessor
instances. It organizes event management for applications by mapping each application's name to an event processor, which manages and fires callbacks provided by the subscriber to a given application-specific event.Example Use Case
Imagine you have a Notepad application that wants to subscribe to events from a Calculator application to display the numbers typed in the Calculator:
EventProcessor
instance with watch permissions for the Calculator from theEventOperator
.Design Pattern
Instances of
EventProcessor
are stored within a static map insideEventOperator
, keyed by application names. This prevents cross-application event collisions, maintains a clean separation of events, and allows multiple applications to subscribe to the same application-specific events efficiently.Functionality
EventOperator
manages singleton instances ofEventProcessor
for different applications. Retrieves existing instances or creates new ones as needed.EventProcessor
manages its own subscriptions, handling the addition, emission, and removal of events. It uses a map where event names are keys, and values areEvent
objects that hold detailed event information and subscriptions.eventTimes
map to meet specific timing requirements forFsWatcher
.Code Examples
Event Types Explained
Within our system, events are categorized into four main types:
~/.zowe/.events/Zowe/$userEventName
$ZOWE_CLI_HOME/.events/Zowe/$sharedEventName
~/.zowe/.events/$appName/$customSharedEventName
$ZOWE_CLI_HOME/.events/$appName/$customSharedEventName
How to Test
Operate the sample VSCE without error:
Review Checklist
I certify that I have: