Skip to content

[WIP] MessageBus proposal#10

Open
danekszy wants to merge 27 commits intomasterfrom
loader-messege-bus
Open

[WIP] MessageBus proposal#10
danekszy wants to merge 27 commits intomasterfrom
loader-messege-bus

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 from bd1f494 to 2081536 Compare August 9, 2019 16:39
@danekszy danekszy force-pushed the loader-messege-bus branch 6 times, most recently from b5134de to da20767 Compare August 9, 2019 18:18
@danekszy danekszy force-pushed the loader-messege-bus branch from da20767 to 208eafa Compare August 9, 2019 18:19
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.

3 participants