Giter Site home page Giter Site logo

emojitrack-streamer's Introduction

emojitrack-streamer

Handles emojitracker's SSE endpoints for streaming realtime updates to web clients.

Overall responsibilities:

  • Consumes all the PUBSUB update streams from Redis.
  • Implements a "score summarizer" pipeline, converting the primary score_updates stream from atomic updates (currently incoming at a typical rate of 250-400Hz) to rolled-up summary blobjects emitted at a maximum rate of 60Hz.
  • Accepts client connections on SSE endpoint pools.
    • Namespace connections based on request path resource IDs, allowing a client to subscribe to updates on arbitrary objects.
    • Performs filter operations so that detail updates are only sent to SSE streams with interested clients connected.
    • Multiplex all streams to clients appropriately.

Additionally we must:

  • Periodically reports on status of the connection pools to the admin cluster.
  • Periodically log status of the connection pools to graphite.

Legacy note

This represents the original version of emojitracker's SSE streaming functionality, being isolated into it's own service so that it can either be more easily improved or swapped out later. It is being moved "as is" as much as possible for now. Most importantly by moving this into it's own service we can horizontally scale streaming independently of the normal web frontend/API.

This version uses MRI Ruby threads for concurrency, but has EventMachine reactor stuff sprinkled in for timers and whatnot. (Told you it was a bit of a mess!)

Unlike the new experimental NodeJS version of emojitrack-streamer, this version still has the ability to manually manage client socket connections via SSE_RECONNECT timing, forced disconnects, and exposing AJAX endpoints for clients to manually indicate when they are done with a resource. This enables it to work in environments where websocket-style connections are not natively supported (for example, behind Heroku's routing later if you don't have the websockets lab project enabled.)

Streaming API

This implementation defined the original API spec, but the source of truth for the spec is now defined in emojitrack-streamer-spec. Go there for streaming API documentation and acceptance tests.

Developer setup

Instructions to go here.

Other parts of emojitracker

This is but a small part of emojitracker's infrastructure. Major components of the project include:

Many of the libraries emojitrack uses have also been carved out into independent open-source projects, see the following:

emojitrack-streamer's People

Contributors

mroth avatar

Watchers

 avatar

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.