tonkpils / celluloid-eventsource Goto Github PK
View Code? Open in Web Editor NEWCelluloid implementation of Server Sent Events
License: MIT License
Celluloid implementation of Server Sent Events
License: MIT License
Currently only the necessary headers are sent on the HTTP request. I would like to have it accept and send headers on the request
When looking up Content-Type from the response, the header is case insensitive so we need to account for that.
c = Celluloid::EventSource.new('....')
c.on_message do |message|
puts "Message #{message}"
end
does not work since the async.run
starts the connection on the initializer.
One way to mitigate this is to extract the run execution into a separate method and have the user start the eventsource. Still, any point after the run is executed it will not accept changes to the event handlers.
Find a better way to test that events are received without using sleep
If the server sets Transfer-Encoding: chunked
headers it causes issues with the current parsing of the stream.
This is just a nice to have since http://www.w3.org/TR/2009/WD-eventsource-20091029/#notes cautions when using chunking anyway...
I've started a branch with a simple test case 7272fdc
based on http://www.w3.org/TR/2012/CR-eventsource-20121211/
Processing of the stream should be done on a line by line basis and dispatch should be done only on certain cases.
According to http://www.w3.org/TR/2012/CR-eventsource-20121211/
Currently, a data string is sent back to the event handlers. This should be a MessageEvent object containing data
, last_event_id
and origin
Currently the query string can be added through the url. It'd be nice to be able to specify a hash of query arguments and send it on the request.
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.