Closed tpitale closed 10 years ago
@kenichi any interest in this? One way or the other?
@tpitale sorry, been on vacation - looking...
No worries, one never knows :smile:
@tpitale hey, i forked and tried to get your gist to work:
https://gist.github.com/kenichi/de652d1ef7705716c126
but i can't get anything but bizarre encoding errors from chrome. am i doing something obviously wrong?
Oh, the gist is a proof of the SSE concept. I haven't checked to see if it works standalone in some time.
If it helps, I'll try to get it working tomorrow.
@tpitale i think the feature is a good one, and should be added. websockets are great, but SSE/EventSource is a better choice for many cases. do you have ideas for implementation in angelo?
i tend towards sinatra compatibility, but am open to deviate. here's a sinatra example: https://gist.github.com/rkh/1476463
Yeah, I'll try to create something soon and send a PR. Thanks @kenichi!
@tpitale i played with the gist a bit more, and got it working:
@tpitale what do you think of this addition to the DSL?
That looks great @kenichi!
I'd be happy to try to play with it in a pet project tonight or tomorrow :-)
@tpitale it seems like
var es = new EventSource('/sse');
always performs a GET request, so i'm thinking of moving it to the top-level like get
, websocket
, etc.
I was going to ask about that. I think eventsource should basically have the similar top level api as get
/websocket
.
cool, me too. i'm gonna try to make that happen over the weekend... we'll see how far i get :smiley_cat:
Thanks @kenichi!
@tpitale ok, i added quite a bit - see the readme additions on the branch at:
https://github.com/kenichi/angelo/tree/sse#sse---server-sent-events
This is sort of a feature request. But, it's one I'm hoping to work on if you're interested in having this as a feature.
There's not too much work to be done on it, and I'll probably just adapt the work I did for this gist example: https://gist.github.com/tpitale/4004298