Client side long polling

#1

Hi Tobias,

The time has come that we need to have some kind of solution for using long polling from the client side. We are thinking we will implement something ourselves, and we are wondering if you have any pointers for us that could help us make faster progress?

I recall you mentioned it was 2 days work for you to implement this in AutobahnJS because you wanted to do some refactoring. If you think our efforts could support you in this, please let me know.

Cheers,

Scott

0 Likes

#2

Hi Scott,

Hi Tobias,

    The time has come that we need to have some kind of solution for
using long polling from the client side. We are thinking we will
implement something ourselves, and we are wondering if you have any
pointers for us that could help us make faster progress?

The AutobahnPython side of WAMP long-poll is finished. You can test it in Crossbar using curl as a client as described here:

https://github.com/crossbario/crossbar/wiki/WAMP%20Long-Poll%20Service

I previously started the long-poll in AutobahnJS here

https://github.com/tavendo/AutobahnJS/blob/master/package/lib/longpoll.js

This code works in principle already (I could issue calls, events etc), but it needs to be refactored into the whole AutobahnJS code base.

I see what I can do the coming days, but I am currently in England for a week - have to see how much I find time to code ..

Cheers,
/Tobias

···

Am 05.09.2014 20:28, schrieb Scott Wittenburg:

    I recall you mentioned it was 2 days work for you to implement this
in AutobahnJS because you wanted to do some refactoring. If you think
our efforts could support you in this, please let me know.

Cheers,
Scott

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
To post to this group, send email to autob...@googlegroups.com
<mailto:autob...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/autobahnws/b5f7522e-eccd-4e90-9b8f-66ece089efbf%40googlegroups.com
<https://groups.google.com/d/msgid/autobahnws/b5f7522e-eccd-4e90-9b8f-66ece089efbf%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#3

Hi Tobias,

Hi Scott,

Hi Tobias,

The time has come that we need to have some kind of solution for

using long polling from the client side. We are thinking we will

implement something ourselves, and we are wondering if you have any

pointers for us that could help us make faster progress?

The AutobahnPython side of WAMP long-poll is finished. You can test it
in Crossbar using curl as a client as described here:

https://github.com/crossbario/crossbar/wiki/WAMP%20Long-Poll%20Service

I previously started the long-poll in AutobahnJS here

https://github.com/tavendo/AutobahnJS/blob/master/package/lib/longpoll.js

This code works in principle already (I could issue calls, events etc),
but it needs to be refactored into the whole AutobahnJS code base.

I see what I can do the coming days, but I am currently in England for a
week - have to see how much I find time to code …

Hmmm, then maybe we’ll try to just get your AutobahnJS repo and work with that. If we can get that working in our environment, we can probably hold off on developing anything ourselves.

Thanks for the tips! We’ll let you know how it goes :slight_smile:

Cheers,

Scott

···

On Wednesday, September 10, 2014 2:37:32 AM UTC-6, Tobias Oberstein wrote:

Am 05.09.2014 20:28, schrieb Scott Wittenburg:

Cheers,

/Tobias

I recall you mentioned it was 2 days work for you to implement this

in AutobahnJS because you wanted to do some refactoring. If you think

our efforts could support you in this, please let me know.

Cheers,

Scott

You received this message because you are subscribed to the Google

Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send

an email to autobahnws+...@googlegroups.com

mailto:autobahnws+unsub...@googlegroups.com.

To post to this group, send email to auto...@googlegroups.com

mailto:autob...@googlegroups.com.

To view this discussion on the web visit

https://groups.google.com/d/msgid/autobahnws/b5f7522e-eccd-4e90-9b8f-66ece089efbf%40googlegroups.com

<https://groups.google.com/d/msgid/autobahnws/b5f7522e-eccd-4e90-9b8f-66ece089efbf%40googlegroups.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.

0 Likes

#4

Hi Scott,

alright, I've added long-poll to AutobahnJS. Still beta, needs more polish.

The long-poll transports works with IE9 (see screenshot).

There are issues left with IE8 (and below), likely due general JS issues. If you want to help: debugging IE8 and lower would be welcome!

Here is how to test:

1) Update and install latest Crossbar from GitHub master.

2) Clone AutobahnJS repo, checkout "longpoll" branch and build by doing "make bundle" from repo root.

3) Change to "test/longpoll" in AutobahnJS repo and start crossbar ("crossbar start")

4) Open "http://localhost:8080/" in Chrome, IE10 or IE9. You should see a transport of type WebSocket or Long-Poll being created and used.

Cheers,
/Tobias

0 Likes

#5

Hi Tobias,

Sorry I didn’t get back to you right away, I have been away on travel this week. But this is really fantastic! Thanks for moving this up in your priority list, I will give it a try as soon as I have a chance. If I run into any issues or questions, I will let you know.

Again, I really want to thank you for always being so responsive on this list, and for putting in such great effort to keep the community engaged. Additionally, I feel you went above and beyond again by implementing the client-side long polling so quickly. Keep up the great work :slight_smile:

Cheers,

Scott

···

On Saturday, September 20, 2014 10:56:47 AM UTC-6, Tobias Oberstein wrote:

Hi Scott,

alright, I’ve added long-poll to AutobahnJS. Still beta, needs more polish.

The long-poll transports works with IE9 (see screenshot).

There are issues left with IE8 (and below), likely due general JS
issues. If you want to help: debugging IE8 and lower would be welcome!

Here is how to test:

  1. Update and install latest Crossbar from GitHub master.

  2. Clone AutobahnJS repo, checkout “longpoll” branch and build by doing
    “make bundle” from repo root.

  3. Change to “test/longpoll” in AutobahnJS repo and start crossbar
    (“crossbar start”)

  4. Open “http://localhost:8080/” in Chrome, IE10 or IE9. You should see
    a transport of type WebSocket or Long-Poll being created and used.

Cheers,

/Tobias

0 Likes

#6

Does this support automatic fallback from WebSockets to long polling, or do you have to choose either WebSockets or long polling when establishing the connection?

Have you considered using a XHR -> WebSocket upgrade approach, instead of WebSocket -> XHR fallback? Socket.io now uses the latter approach, as it avoids timeouts which negatively impact user experience.

Cheers,

Emile

···

On Saturday, September 20, 2014 1:56:47 PM UTC-3, Tobias Oberstein wrote:

Hi Scott,

alright, I’ve added long-poll to AutobahnJS. Still beta, needs more polish.

0 Likes

#7

I took a look at the AutobahnJS source code, and I see that one can pass an array of transports to the Connection. When you connect, it traverses that list of transports until one of them works. By passing a WebSocket transport before a Long-Poll transport in the transport array, it will effectively fall back to long polling if the WebSocket connection fails.

Is this interpretation correct?

P.S. Anyone who knows can answer; it doesn’t have to be Tobias. :slight_smile:

···

On Friday, October 3, 2014 5:41:40 PM UTC-3, emile...@gmail.com wrote:

Does this support automatic fallback from WebSockets to long polling, or do you have to choose either WebSockets or long polling when establishing the connection?

Have you considered using a XHR -> WebSocket upgrade approach, instead of WebSocket -> XHR fallback? Socket.io now uses the latter approach, as it avoids timeouts which negatively impact user experience.

Cheers,

Emile

0 Likes