How does the live, real-time typing work in Google Wave?
Asked Answered
P

9

34

I'm sure Wave doesn't poll the server every millisecond to find out if the other user has typed something... so how can I see what the other person is typing as they type? And without hogging the bandwidth.

Polymerize answered 31/5, 2009 at 16:39 Comment(1)
There is some information in one of the answers here #929244Sudderth
P
38

Persistent HTTP, Comet

Keep your HTTP connection alive and send characters as they are typed

*Edit in 2014: also, take a look at WebSocket and HTTP/1.1 Upgrade header. Browsers started implementing this around 2010, so I'm adding this to original answer.

Propagandism answered 31/5, 2009 at 16:43 Comment(2)
Does it really use Comet bcoz it use GWT?Discontinuous
comet is a buzzword, it's not any defined framework or technology. you can implement it with gwt, without gwt, and however you likePropagandism
R
6

They probably use Web Sockets, aka server-sent events: http://www.w3.org/TR/websockets The underlying protocol can be found (as a draft) at the IETF.

Update: it doesn't seem WebSockets has any implementation yet; and a video from Google I/O (go to 11:00) talks about a long lived HTTP GET request.

Retrorocket answered 3/6, 2009 at 9:6 Comment(2)
Didn't know there was a restriction like that for users! I'll vote you up to give you some more rep.Crissy
Thanks for your vote, I've now edited my answer to include "more than one hyperlink", and thus actually link to the IETF draft.Retrorocket
D
4

Server Push in GWT

Server push is the Wait, Respond, Close, Re-Open paradigm:

  • Wait: When the GWT code makes a call to your server for some data that you don't have yet, freeze (wait)

  • Respond: Once the requested data is
    available, respond with it

  • Close: Then, close the connection.

  • Re-Open: Once your GWT code receives the response, immediately open up a new connection to query for the next event.

Dovelike answered 17/8, 2009 at 21:29 Comment(0)
P
3

See Video Google Wave: Powered by GWT around at minute 55 (near the end)

Q: How you implement the persistent Connections, the long living http connections

A: Future Plan: HTML5 Web Sockets. Longer term. That's what we use at the moment.

Q: Is there a platform or library for this we can download and play with?

A: Not sure. Don't think so

P.S.: That's what he said. To me it did not make much sense ("future plans" vs "using at the moment"). Any native english speaker might want to verify if I transcribed it correctly?

Porphyritic answered 17/6, 2009 at 17:50 Comment(1)
It's confusing because it's slightly out of context. The answer meant basically: Yes, we're using hanging requests (aka "Comet"). The future plan is to move to WebSockets when implementations are available.Imperialism
T
1

Pure speculation but could it be using the Server Side DOM events from the HTML 5 spec?

Tsimshian answered 5/6, 2009 at 8:35 Comment(0)
I
1

the entire reason for WebSockets is to have the browser keep a bi-directional socket open to a server so that real time communications can be used. When someone types on the other end, in a wave client, it triggers an event that is sent to the server and the server in turn looks to see who should also receive the event and pass them the event, in this case the typed letter.

WebSocket and Comet are different.

Granville

Invidious answered 23/11, 2009 at 15:11 Comment(0)
I
0

Probably comet for now websocket in the future. Because it works in Firefox 3.5 and from what I've read the websocket is only available in the nightly builds of FF... I could be wrong though... as it appears to not work in IE at all.

Inroad answered 14/8, 2009 at 21:30 Comment(0)
B
0

I spent some time reverse-engineering the Google Wave client code (shameless plug for http://antimatter15.com/misc/read/ which is a read-only public client for google wave for all public waves without need of robots or gadgets which was a lot more useful a month ago when Google didn't launch the upgrades).

Anyway, Google uses the GWT framework with certain aspects of the Google Closure library (which is actually open source and documented) and they use the goog.net.BrowserChannel library, which from the comments is also used for chat functionality within gmail.

http://closure-library.googlecode.com/svn/docs/closure_goog_net_browserchannel.js.html

Biradial answered 24/5, 2010 at 1:8 Comment(0)
J
-1

I would assume that they use ajax requests. Do an XMLHttpRequest, which is asynchronous, and when the server has something to send your browser the javascript callback that was registered gets the data and does whatever with it. So basically the browser requests the next event, handles it, repeats indefinitely.

Joselyn answered 22/11, 2009 at 19:4 Comment(1)
XMLHttpRequest is send once, if no answer was received , connection is terminated, that it. nobody will wait anything. that what "comet" technology does, non-endless GET request.. read about this on wiki.Stefa

© 2022 - 2024 — McMap. All rights reserved.