Giter VIP home page Giter VIP logo

omnistreams-spec's Introduction

Introduction

omnistreams is a specification defining a data streaming system. The project has the following core goals:

  1. Language-agnostic interfaces and semantics for barebones readable (producer) and writable (consumer) streams, including piping, cancellation, and operation (ie map, filter, etc) support.
  2. Dead-simple wire protocol with multiplexing. This is for sending streams between networked machines, processes, threads, coroutines, etc. The only requirement is an underlying reliable, in-order message passing system (ie WebSockets, WebRTC, ZeroMQ, reliable UDP, Go channels, etc)
  3. Pull-based (ie consumer-controlled) backpressure.
  4. Reference implementations and base classes/interfaces in JavaScript, Rust, and Go. This includes convenience functionality for setting up networked streams over WebSockets, ie a Multiplexer implementation for WebSockets.
  5. Extremely simple to understand and implement. If a reasonable amount of performance loss means a greatly simplified design, choose the simple option. A first-year undergrad CS student should be able to make a usefully complete implementation in an arbitrary programming language.

Spec

You can read the specification here

Prior Work

omnistreams are heavily influenced by prior work, especially the excellent Reactive Streams, and ReactiveX. The primary differences are that omnistreams have less functionality (no semantics for multiple subscribers, no built-in operators, etc) and have a heavy focus on streaming data between different programming languages across a network. The most important thing we stole from reactive streams is the pull-based backpressure semantics (see also pull streams).

There's also a lot of overlap with node streams. There are several excellent projects to bring node streams to the browser, and even between the browser and node backend over websockets (see ws-streamify, websocket-stream). In terms of functionality offered (if you only need JavaScript support), omnistreams is very close to binaryjs. Unfortunately, that project appears to be defunct. You can think of omnistreams as an attempt to generalize node streams to work in any programming language, and between any two languages over a network.

The WHATWG Streams API was not as much of a direct influence as the previous, but omnistreams shares a lot of similarity in API. They were both designed with a focus on I/O streaming.

I discovered rsocket some time after completing a working JavaScript implementation of omnistreams. The goals of the two projects appear to be very similar, with rsocket being far more complete and mature. If I had found it when I went looking for a language-agnostic backpressured WebSocket stream multiplexer, I would have spent some time trying to make it work before implementing my own solution. As it stands, the biggest advantage of omnistreams that I see is that it has a much simpler protocol, mostly because it offers far fewer features. This makes it faster to implement for new languages and easier for developers to pick up and use. Knowing that rsocket exists gives me confidence in choosing to keep omnistreams as simple as possible. Also, omnistreams was built from the ground up to support raw byte streams, ie transferring files, in addition to streaming things like JSON or Protobuf objects. Everything is just bytes and the application is responsible for encoding and decoding. I'm sure other systems support byte streams, but it doesn't seem to be a focus. omnistreams is very agnostic to the datatype.

Implementations (in order of completeness)

Additional Streaming Resources

omnistreams-spec's People

Contributors

anderspitman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vebodev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.