Is there an abstraction over publisher and consumer yet?
One implementation detail could be across browser extension contexts (background / content script) : push messages to a browser port, and listen on the other side. That could also work with Redis, RabbitMQ, or whatever system in which one needs to:
- serialize a message (request)
- push/write somewhere
- then possibly deserialize that message and then route/execute things depending on that message type.
This looks a bit like the RPC API, though that use case is not "execute something remotely and wait for success/error", but simply "fire and forget" on the publishing side and "pattern match for incoming messages" on the consuming side.
What it is very useful obviously is the ability to infer the RPC client from the RCP Router. I was thinking that the PublisherClient could be infered from a MessageRouter (on the consuming side).
Am I overthinking this?