use autobahn for "raw" websocket messages?

#1

We have built a websocket-based app, “Oncoscape”

https://github.com/FredHutch/Oncoscape/tree/pshannon-refactor-server-2

for the interactive exploration of molecular and clinical cancer data. We use Javascript (along with d3 and jQuery) in the browser.

Somewhat unusually, but quite successfully, we use R on the server. Simple 4-field JSON messages flow between tabs in the browser, and to

the server as well.

https://github.com/oncoscape/chinook

We now wish to scale up, and to support (among other things) Jupyter notebook connections to browser and server. Crossbar looks like a fine

solution. Which leadis me to my question:

Can we use autobahn and WAMP “one level down” – that is, rather then RPC or pub/sub, we simple send JSON over plain websockets,

thereby

a) benefiting from WAMP infrastructure, and from the crossbar router

b) preserving our R and javascript code in its present form?

In spirt, this would be like embedding a little bit of assembly code in a C program, or calling out to C from with an R package.

Is it possible to get the best of both worlds?

Thank you!

Paul Shannon

0 Likes

#2

Hi Paul,

you can use AutobahnPython at the “raw WebSocket” level. You cannot use Crossbar.io for anything but WAMP.

Rgd Jupyter: it’s trivial to do calls and publishes from inside Jupyter notebooks to WAMP via the HTTP/REST bridge that is included in Crossbar.io (I once did that, but don’t have the code at hand right now … it’s easy though). Doing register/subscribe from inside Jupyter is non-trivial, since that is a classical blocking app.

Cheers,
/Tobias

···

Am Mittwoch, 20. Januar 2016 20:46:35 UTC+1 schrieb Paul Shannon:

We have built a websocket-based app, “Oncoscape”

https://github.com/FredHutch/Oncoscape/tree/pshannon-refactor-server-2

for the interactive exploration of molecular and clinical cancer data. We use Javascript (along with d3 and jQuery) in the browser.

Somewhat unusually, but quite successfully, we use R on the server. Simple 4-field JSON messages flow between tabs in the browser, and to

the server as well.

https://github.com/oncoscape/chinook

We now wish to scale up, and to support (among other things) Jupyter notebook connections to browser and server. Crossbar looks like a fine

solution. Which leadis me to my question:

Can we use autobahn and WAMP “one level down” – that is, rather then RPC or pub/sub, we simple send JSON over plain websockets,

thereby

a) benefiting from WAMP infrastructure, and from the crossbar router

b) preserving our R and javascript code in its present form?

In spirt, this would be like embedding a little bit of assembly code in a C program, or calling out to C from with an R package.

Is it possible to get the best of both worlds?

Thank you!

Paul Shannon

0 Likes