Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.5 KB

README.md

File metadata and controls

42 lines (28 loc) · 1.5 KB

Twine Protocol

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?

Use Cases

  • A front end and a back end
  • A sandboxed process and its host
  • Along running job and its host

Why?

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.

Implementations

State of Development

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.