-
Notifications
You must be signed in to change notification settings - Fork 3.9k
op-node: event-system with tracing #11099
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
Conversation
|
|
ajsutton
left a comment
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 the one question about thread safety when iterating a slice that may be modified from another thread at the same time.
ajsutton
left a comment
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.
Yeah I think that's nicer. Not as elegant in some ways but much easier to understand the setup code.
|
@protolambda While reading code of This question also applies to other |
|
The AttachEmitter choice is deliberate, since otherwise it makes it difficult to register the deriver with the event system, as the emitter is a unique instance created for the deriver. |
Description
This PR:
event.System, an interface that allows:Deriver/Emitterevent.Queueintoevent.GlobalSyncExec: implements the newevent.Executorinterface. The system uses an executor to queue up the emitted events to, and run the derivers with. This implementation is a synchronous queue, but more implementations are coming. (see parallel events processing work).OnEvent(ev Event) bool. The new bool return value identifies whether it was an ignored pass-through (= false) or actually processed (= true). This helps with reducing noise in event tracing. Later on we can maybe also stop theSystemfrom running an event-type that was previously ignored.Tests
Additional context
This could be the start of more runtime customization; adding/removing derivers is really easy, allowing customization by composing the system differently. Perhaps a plugin system can be built in the future on this.
Metadata
Fix #11097