http://www.w3.org/Bugs/Public/show_bug.cgi?id=13763

Ian 'Hixie' Hickson <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|                            |WONTFIX

--- Comment #6 from Ian 'Hixie' Hickson <[email protected]> 2011-08-13 02:45:44 UTC 
---
It's easy to do this already:

   var queue = [];
   websocket.onmessage = function (event) {
     if (queue.length)
       queue.shift()(event);
   };

   // to send and then wait for response:
   websocket.send('foo');
   queue.push(function (event) {
     // rest of function goes here
   });

...or some such. Basically works like polling but without having to worry about
missing other events if you have other things going on.

(code above is untested so may have syntax errors)

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Reply via email to