Twine Protocol is a developer-friendly way of getting two running processes to have non-trivial message and payload exchanges.
See the wiki where I dump some thoughts and current info.
The implementations can work using different transports:
- Unix sockets
- WebScokets
- WebRTC (maybe? Haven't tried to implement yet)
- postMessage?
- A front end and a back end
- A sandboxed process and its host
- Along running job and its host
I wanted a simple way to communicate between two processes without reinventing a message protocol every time. More:
- Simple and effective. Lightweight.
- Reasonably performant. Small messages. Minimal handshake.
- Quick to adopt: no code-gen. Just import and use.
- Reusable in different environments (transports). Use the same APIs and patterns, no need to learn something new.
- Payload-agnostic. Send JSON, strings, binary data, or just a single byte.
- Bidirectional. Either side can send.
- Powerful enough to support non-trivial exchange of information that might occur between two running functions.
It's extremely early. I'm dogfooding this in Dropserver and learning as I go. Implementations leave a lot to be desired.
There is more in the Wiki here on Github.