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

[FEATURE REQUEST, RR2] Events package update #496

Closed
rustatian opened this issue Jan 24, 2021 · 0 comments · Fixed by #838, #839 or roadrunner-server/roadrunner-plugins#103
Closed

[FEATURE REQUEST, RR2] Events package update #496

rustatian opened this issue Jan 24, 2021 · 0 comments · Fixed by #838, #839 or roadrunner-server/roadrunner-plugins#103
Assignees
Labels
A-other Area: other S-RFC Request: Request for comments Y-Medium Priority: Medium
Milestone

Comments

@rustatian
Copy link
Member

rustatian commented Jan 24, 2021

At the moment event pkg in the RR2 lays mostly on the interface{} as the event. It's not the best solution, because:

  1. We have to use type casting for every event to search for an event of a needed type.
  2. We can't subscribe only to the particular event (for example EventMaxMemory) or set of needed events.
  3. When printing the event, we have to guess if there is Payload or Worker in the event or not, so no unification (only via casting to Pool or Worker event type).
  4. TBD

I propose to create:

  1. A special interface for all events, which should print user-friendly messages to the log and provide enough information about the event.
  2. Eliminate Pool and Worker event in the flavor of a unified event type (interface with methods like Payload, Cause, String and etc) [TBD].
  3. Eliminate usage of the func (event interface{}) in flavor to typed events (p.2)
  4. Add the ability to subscribe only to the needed event w/o type casting via the event channel. For example func AddHandler(event EventType, callback chan Events).

These methods in the proposal not finished yet. The description will be updated.

@rustatian rustatian added S-RFC Request: Request for comments A-other Area: other labels Jan 24, 2021
@rustatian rustatian added this to the next milestone Jan 24, 2021
@rustatian rustatian self-assigned this Jan 24, 2021
@rustatian rustatian added the Y-Medium Priority: Medium label Feb 14, 2021
@rustatian rustatian removed this from the next milestone Mar 28, 2021
@rustatian rustatian changed the title [RR2, Next] Events package update [FEATURE REQUEST, RR2] Events package update May 20, 2021
@rustatian rustatian added this to the 2.6.0 milestone Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment