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

Exchange of messages between broker and gateway via message channels #225

Open
danielwiehl opened this issue Mar 25, 2023 · 2 comments
Open
Assignees
Labels
performance Related to the performance of the platform.
Projects

Comments

@danielwiehl
Copy link
Collaborator

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

Consider using web channels provided by the MessageChannel Web API for the message exchange between the gateway and broker. This allows for a dedicated channel per message class and thus eliminates the manual mapping of messages to handlers in the broker/gateway, which massively reduces the load on the UI thread.

A PoC has illustrated that the message throughput can be more than doubled compared to the current solution.

Describe the solution you'd like

Instead of exchanging messages on a single channel (the window channel), the platform uses a dedicated MessageChannel per message class. The gateway connects to the broker using window.postMessage and transfers message ports for subsequent communications (i.e., for publishing a message, publishing an intent, subscribing to a topic, subscribing to an intent, ...). In addition, a dedicated channel is established for each interaction with the broker, i.e., for receiving the ACK message, the response(s) to a request-response communication, and messages for a subscription.

@danielwiehl danielwiehl added the performance Related to the performance of the platform. label Mar 25, 2023
@danielwiehl danielwiehl added this to the v1.0.0 milestone Mar 25, 2023
@danielwiehl danielwiehl self-assigned this Mar 25, 2023
@danielwiehl danielwiehl added this to Triage in SCION via automation Mar 25, 2023
@danielwiehl
Copy link
Collaborator Author

See branch issue/message-channel for inspiration.

@danielwiehl
Copy link
Collaborator Author

Note that this change must be backward compatible and that we need to migrate the scion-rcp/ch.sbb.scion.rcp.microfrontend library.

@danielwiehl danielwiehl moved this from Triage to Backlog Microfrontend Platform in SCION Mar 25, 2023
@k-genov k-genov removed this from the v1.0.0 milestone May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Related to the performance of the platform.
Projects
SCION
  
Backlog Microfrontend Platform
Development

No branches or pull requests

2 participants