Giter Site home page Giter Site logo

redisse's People

Contributors

etiennebarrie avatar

Stargazers

 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  avatar

redisse's Issues

Server crashes with some values of lastEventId

Repro:

  • lastEventId is a number so it triggers handling history events
  • lastEventId is large enough that no history events need to be sent (e.g. it's larger than the last event id sent by the server)

With a clean Redis db, this is enough to crash the server:

$ curl localhost:4242/events?lastEventId=42 --header 'Accept: text/event-stream'

Binary for server

Right now we require to create a server object (that extends Redisse), configure it and write a server binary using that object (cf. usage section of the README).
We could let people configure Redisse directly and provide the binary instead.

Use Redis scripts

For publishing and fetching history, instead of sending several Redis commands, we could use Redis scripts

lastEventId event

A client connects, but doesn't receive any event. Then the connection fails and at that moment some relevant events for the client are published. When the client reconnects, it won't send any lastEventId because it has never seen one, and as such it will never learn about these events.

We could simply work around this problem by always sending an event after a connection, which will set the client’s lastEventId. Three cases:

  • client asked for history, there were history events, and whether the full requested history could be fetched or not, it now knows the latest relevant event id or it knew it already, so we're good
  • client asked for history but there were no history events for them (perhaps because lastEventId was larger than it should have been, or client can't access the same channels they used to)
  • client didn't ask for history

In these last two cases, simply sending an event containing the server’s lastEventId allows the client to have a reference event id in case the connection is lost. Support is optional for the client but the event will always be sent by the server.

The type of the event could be called, appropriately, lastEventId.

Stats

Some stats are computed, and are expected to be sent to Statsd or similar via a Goliath plugin. Also plugins are not ideal because they prevent using a totally different implementation of the server.
Statsd support could be included but at least an HTTP endpoint for the server could return these stats.

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.