Code Monkey home page Code Monkey logo

monix-sample's Introduction

Monix Client/Server Sample

Sample of a mixed client/server application demonstrating the streaming of values over web-socket, both simple and with back-pressure applied (by means of the Reactive Streams protocol), using Monix for both the server and the client ;-)

See: monix-sample.herokuapp.com

Gitter

Overview of the code:

NOTES:

  • we are exposing 2 versions of webSocket connections, one that is back-pressured as a matter of the server-side protocol and one that is not
  • both versions are protected by buffers that start dropping events in case the client is too slow, but the difference is that for the back-pressured version the buffer is being maintained server-side
  • by applying back-pressure in the protocol, the server is informed of the rate at which the client can consume and thus there is no risk for the server in case we've got clients that are too slow; on the other hand for the simple version the server can be crashed on clients that are too slow in receiving their events, as that actor's mailbox is unbounded
  • the back-pressured version needs server-side cooperation / implementation and is thus more difficult to develop

In order to develop and execute the project locally:

sbt run

For Heroku deployment:

sbt stage deployHeroku

The project is based on the cool play-with-scalajs-example template by @vmunier, so you get the auto-reload coolness of Play in combination with Scala.js.

~;Enjoy

monix-sample's People

Contributors

alexandru avatar aoprisan avatar mihaisoloi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.