Skip to content
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

Adopting an Event Bus for Efficient State Management #322

Open
taldekar opened this issue Jan 14, 2025 · 0 comments
Open

Adopting an Event Bus for Efficient State Management #322

taldekar opened this issue Jan 14, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@taldekar
Copy link
Contributor

Is your feature request related to a problem? Please describe.

The current project architecture employs custom brokers to manage plugin state changes within the IDE. For example, an Authentication Status Provider and associated Listeners update various Views based on the user's authentication status. While this approach works, it presents several challenges as the system scales:

  • Proliferation of custom brokers: As events increase, developers must implement multiple brokers, leading to increased complexity and potential code duplication.
  • Error handling complexity: Ensuring errors in one listener don’t prevent notifications from being sent to other listeners requires careful implementation, increasing the risk of subtle bugs.
  • Performance bottlenecks: Listeners often execute on the same thread as the event publisher, which can impact plugin responsiveness, especially with time-consuming operations or numerous listeners.
  • Concurrency and Ordering Challenges: While single-threaded custom brokers maintain natural event order, they limit concurrency. Introducing multi-threading to improve performance can lead to race conditions, deadlocks, and difficulties in maintaining consistent event ordering, potentially resulting in inconsistent plugin states.
  • Lack of event persistence: Custom brokers typically don’t provide built-in support for event persistence. This can make it difficult to implement features like event replay, auditing, or recovering from system failures.

Describe the solution you'd like

An event bus architecture presents an effective solution to the current challenges in our IDE plugin system. By providing a centralized mechanism for event management, an event bus can simplify our codebase, improve scalability, and enhance performance through better concurrency handling. It offers built-in error management, supports event persistence, and promotes a more decoupled architecture. This approach not only addresses our immediate issues with custom brokers but also sets a foundation for future enhancements, making our system more robust, maintainable, and extensible. Implementing an event bus can significantly streamline our development process and improve the overall reliability of our plugin architecture.

@taldekar taldekar added the enhancement New feature or request label Jan 14, 2025
@taldekar taldekar self-assigned this Jan 14, 2025
This was referenced Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant