You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment event pkg in the RR2 lays mostly on the interface{} as the event. It's not the best solution, because:
We have to use type casting for every event to search for an event of a needed type.
We can't subscribe only to the particular event (for example EventMaxMemory) or set of needed events.
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).
TBD
I propose to create:
A special interface for all events, which should print user-friendly messages to the log and provide enough information about the event.
Eliminate Pool and Worker event in the flavor of a unified event type (interface with methods like Payload, Cause, String and etc) [TBD].
Eliminate usage of the func (event interface{}) in flavor to typed events (p.2)
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.
The text was updated successfully, but these errors were encountered:
At the moment
event
pkg in the RR2 lays mostly on theinterface{}
as the event. It's not the best solution, because:EventMaxMemory
) or set of needed events.Payload
orWorker
in the event or not, so no unification (only via casting to Pool or Worker event type).I propose to create:
Payload
,Cause
,String
and etc) [TBD].func (event interface{})
in flavor to typed events (p.2)func AddHandler(event EventType, callback chan Events)
.These methods in the proposal not finished yet. The description will be updated.
The text was updated successfully, but these errors were encountered: