ropensci / unconf17

Website for 2017 rOpenSci Unconf
http://unconf17.ropensci.org
64 stars 12 forks source link

A robust websockets client package #43

Open hrbrmstr opened 7 years ago

hrbrmstr commented 7 years ago

I have a personal but non-pressing need for this. Miles also hinted he needs it:

https://twitter.com/milesmcbain/status/854907654702940162

websockets is defunct and not feature complete client-wise.

There are many reasons this won't be "simple" but it might be a good project to have folks who haven't done C[++]-backed packages pair with folks who have and see what it's like.

MilesMcBain commented 7 years ago

Yep. Pretty interested in this!

I fall into the 'folks who haven't done C[++] backend packages' category, but I would be keen to be guided by someone who has. There are a number of C++ implementations we could try to wrap. This one seems to be winning the GH star wars, for whatever that's worth: https://github.com/uWebSockets/uWebSockets

hadley commented 7 years ago

@jcheng5 might be interested in this too

hrbrmstr commented 7 years ago

Miles: Can you bullet some use-cases? A big part of websockets is processing received events vs active queries, so it'd be cool to know what specifics you have to design the pkg direction.

i.e. most servers that are websocket-based that are more active-query & immediate response-based dumb down to HTTP GET pretty well but there are those that don't so this is one potential use case.

another i can think of is having an R process that connects and then is always running and processing websocket data (i.e. storing into a database or a file or processing and sending out/back)

On Fri, Apr 21, 2017 at 10:23 AM, Hadley Wickham notifications@github.com wrote:

@jcheng5 https://github.com/jcheng5 might be interested in this too

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ropensci/unconf17/issues/43#issuecomment-296204617, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfHtkqfWFQ1-l5CiG7eoWncBVQWrD8Nks5ryLvjgaJpZM4NC1hr .

MilesMcBain commented 7 years ago

My usecase is streaming visualisations. The inspiration is Bokeh server which has a nice protocol that transmits over ws://. It has a message that contains an entire serialised vis and another message that carries the "diff" to the previous state. I would like to be able to implement something similar. The bidirectionally of ws becomes useful when you imagine extending streaming to multi-user sessions, where a user can interact with the vis and have changes propagate.

I think I'm talking event based processing here. I need two types of handlers for those two messages.

I can imagine consuming and munging streaming data from IOT stuff would be another use case. Again this feels event based to me, but I am not really sure of what you mean by active query.

hrbrmstr commented 7 years ago

that was extremely helpful :-) I'm wondering if it might be handy to add this as a Shiny event handler as well.

ws is supposed to be event-driven (as you said) but more than a few sites use it in place of traditional GET requests (for many, many reasons) in a more of a client-event-driven mode vs server-event-driven mode.

On Fri, Apr 21, 2017 at 8:22 PM, Miles McBain notifications@github.com wrote:

My usecase is streaming visualisations. The inspiration is Bokeh server http://bokeh.pydata.org/en/latest/docs/user_guide/server.html which has a nice protocol that transmits over ws://. It has a message that contains an entire serialised vis and another message that carries the "diff" to the previous state. I would like to be able to implement something similar. The bidirectionally of ws becomes useful when you imagine extending streaming to multi-user sessions, where a user can interact with the vis and have changes propagate.

I think I'm talking event based processing here. I need two types of handlers for those two messages.

I can imagine consuming and munging streaming data from IOT stuff would be another use case. Again this feels event based to me, but I am not really sure of what you mean by active query.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ropensci/unconf17/issues/43#issuecomment-296332991, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfHtph-YcjjywUORRNfg6HLiG1-yNleks5ryUhHgaJpZM4NC1hr .

MilesMcBain commented 7 years ago

The Shiny event handler would be quite useful for my case. :+1: Probably for others as well.

stefaniebutland commented 6 years ago

Repo: https://github.com/ropenscilabs/webrockets Blog post: Launching webrockets at runconf17