tigerlily / redisse Goto Github PK
View Code? Open in Web Editor NEWRedisse – Redis-backed Server-Sent Events
License: MIT License
Redisse – Redis-backed Server-Sent Events
License: MIT License
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:
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
.
For publishing and fetching history, instead of sending several Redis commands, we could use Redis scripts
Repro:
With a clean Redis db, this is enough to crash the server:
$ curl localhost:4242/events?lastEventId=42 --header 'Accept: text/event-stream'
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.
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.
Even when the client has disconnected, the heartbeat EM periodic timer will keep running.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.