Closed williazz closed 10 months ago
high level question: could the addition and usage of an event bus impact the memory/performance footprint of the web client on web applications?
high level question: could the addition and usage of an event bus impact the memory/performance footprint of the web client on web applications?
We are currently only monitoring the size and relying design principles to limit memory and cpu usage. I have also been thinking about how to objectively monitor this performance.
But from a design perspective, I think the impact is minimal.
My thoughts on (1) vs (2): If doing (1), this topic allows any plugin to listen for any event. Publish all events under an ‘events’ topic. If doing (2), this topic is for the specific purpose of tracking resource/nav event Ids. Return the event id from recordEvent and publish an <event id, url> tuple.
Purpose
This PR creates the structure necessary for sharing information between plugins.
Uses cases:
Revisions
Revision 1
I have created
EventBus
with topic-based filtering. I implemented our own instead of taking on a dependency because we only need a few extremely simple features.context.bus.subscribe(topic, callback)
context.bus.dispatch(topic, message)
bus.dispatch(eventType, message)
Revision 2
Revision 3
Revision 4
Examples
Use case 1: PluginA finds eventId's of events from PluginB
Use case 2: Count in-flight fetch/xhr requests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.