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

[WIP] MessageBus proposal #10

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open

[WIP] MessageBus proposal #10

wants to merge 27 commits into from

Conversation

danekszy
Copy link

Hey, here's a proposal for MessageBus.
It consists of 2 sides - Provider (loader) and Consumer (iframe).
When first initiating the app, it's the Consumer that plays the active role, pushing it's MessageChannel to the Provider, since Consumer is more aware of when it's ready to initiate the communications.
When setting up the bus, you can send (schedule) messages right away - they'll be queued and sent what both sides finish the handshake and acknowledge their readiness for receiving the messages.

From the user perspective you can use one of 2 approaches:

  • Listen to messages as they come (async) and optionally react to them (for example send some msg back)
  • Use Requests which hide the subscription logic by rewriting actions/messages and wrapping this into Promise based API. This will come in handy when dealing with simple request-response model (eg. querying for some specific information).

Looking forward to your comments.
In the meantime I'll be working on remaining features / edge-cases and writing tests.

@danekszy danekszy force-pushed the loader-messege-bus branch 6 times, most recently from b5134de to da20767 Compare August 9, 2019 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants