Skip to content

Draft: [POC] Add a basic event bus implementation

Thomas Randolph requested to merge tor/poc/base-ucl-implementation into master

What does this MR do and why?

Add a basic event bus implementation

Differences from the one already in the codebase:

  • Won't block the main thread
    • drain will loop, but can be modified to pause
    • the generator bus inherently pauses until the iterator is called again (allowing more fine-grained control than the brute force loop in drain)
    • all subscribers are called with setTimeout, so they are asynchronous (as soon as possible, but non-blocking)
  • Somewhat emulates an Observable with the concept of subscriptions, unsubscribing, and the iterator next call. Also somewhat emulates back-pressure by building and draining a queue instead of synchronously calling a list of functions directly.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Merge request reports