You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A key feature of omnistreams vs something like muxado or yamux is that we assume we're running on top of a frame-oriented transport, instead of a stream-oriented one. This makes it simple and clean to implement things like streams of datagrams or discrete JSON events, in addition to byte streams. Otherwise you would have to add your own framing on top. If your underlying transport is something like TCP this isn't that big of a deal, since you'd need to anyway. But when running on WebSockets, you're building
a frame transport (datagrams/events) on top of
a stream transport (muxado/yamux) on top of
a frame transport (WebSocket) on top of
a stream transport (TCP) on top of
a "frame" transport (IP)
omnistreams lets you invert the last two so you end up with
a frame transport (omnistreams) on top of
a frame transport (WebSocket) on top of
a stream transport (TCP) on top of
a "frame" transport (IP)
Not only have we cut out an entire layer, it also has better alignment since both omnistreams and WebSocket are frame oriented.
Note that if you want to run byte streams on top of omnistreams you're back to this:
a stream transport (omnistreams) on top of
a frame transport (WebSocket) on top of
a stream transport (TCP) on top of
a "frame" transport (IP)
You've still sort of cut out a layer since omnistreams natively supports byte streams, but technically the conversion between frames and byte streams has to be done, so that layer is really still there, it's just abstracted away for you.
I was originally using muxado for Waygate, by simply using this to turn WebSockets into streams. It worked well for me, but there are some scary caveats that I still don't fully understand on that page. I originally started moving from muxado to omnistreams because I wanted datagram support and I couldn't bring myself to add another layer on top, so here we are.
The text was updated successfully, but these errors were encountered:
anderspitman
changed the title
Potential problems with large messages
omnistreams vs muxado/yamux
Aug 17, 2024
A key feature of omnistreams vs something like muxado or yamux is that we assume we're running on top of a frame-oriented transport, instead of a stream-oriented one. This makes it simple and clean to implement things like streams of datagrams or discrete JSON events, in addition to byte streams. Otherwise you would have to add your own framing on top. If your underlying transport is something like TCP this isn't that big of a deal, since you'd need to anyway. But when running on WebSockets, you're building
a frame transport (datagrams/events) on top of
a stream transport (muxado/yamux) on top of
a frame transport (WebSocket) on top of
a stream transport (TCP) on top of
a "frame" transport (IP)
omnistreams lets you invert the last two so you end up with
a frame transport (omnistreams) on top of
a frame transport (WebSocket) on top of
a stream transport (TCP) on top of
a "frame" transport (IP)
Not only have we cut out an entire layer, it also has better alignment since both omnistreams and WebSocket are frame oriented.
Note that if you want to run byte streams on top of omnistreams you're back to this:
a stream transport (omnistreams) on top of
a frame transport (WebSocket) on top of
a stream transport (TCP) on top of
a "frame" transport (IP)
You've still sort of cut out a layer since omnistreams natively supports byte streams, but technically the conversion between frames and byte streams has to be done, so that layer is really still there, it's just abstracted away for you.
I was originally using muxado for Waygate, by simply using this to turn WebSockets into streams. It worked well for me, but there are some scary caveats that I still don't fully understand on that page. I originally started moving from muxado to omnistreams because I wanted datagram support and I couldn't bring myself to add another layer on top, so here we are.
The text was updated successfully, but these errors were encountered: