Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
* HTML5 WebSockets
@ 2009-11-24 19:24 Eric Wong
       [not found] ` <20091124192430.GA4965-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2009-11-24 19:24 UTC (permalink / raw)
  To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw

Hi all,

The Revactor/ThreadSpawn/ThreadPool concurrency models *should* already
support HTML5 WebSockets out-of-the-box right now with the respective
TeeInput (streaming "rack.input" support).  You'll probably want to make
sure the Rack::Chunked middleware is loaded for anything you run, but
other than that everything should work provided you have a working
client-side implementation...

I'm terrible at doing anything interactive on web browsers[1] and I
don't think any current browsers out there support WebSockets natively,
but there are ways to mimic it with JS libraries it seems.

If anybody can code anything up and put up a demo, that would be great.


I'll get around to adding a Fiber-based concurrency model which should
work with TeeInput, too.

[1] - guess why the bug tracker for this project is a mailing list :)

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: HTML5 WebSockets
       [not found] ` <20091124192430.GA4965-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
@ 2009-12-10 23:32   ` Eric Wong
       [not found]     ` <20091210233236.GA23608-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2009-12-10 23:32 UTC (permalink / raw)
  To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw

Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org> wrote:
> Hi all,
> 
> The Revactor/ThreadSpawn/ThreadPool concurrency models *should* already
> support HTML5 WebSockets out-of-the-box right now with the respective
> TeeInput (streaming "rack.input" support).  You'll probably want to make
> sure the Rack::Chunked middleware is loaded for anything you run, but
> other than that everything should work provided you have a working
> client-side implementation...
> 
> I'm terrible at doing anything interactive on web browsers[1] and I
> don't think any current browsers out there support WebSockets natively,
> but there are ways to mimic it with JS libraries it seems.
> 
> If anybody can code anything up and put up a demo, that would be great.

The new version of Chrome supports Web Sockets, so yes, I'd like to
confirm that our streaming "rack.input" support works with Web Sockets.

As always, I'm trying to avoid GUI development myself, but may end
up having to like I did with upr (http://upr.bogomips.org/) and
gaining more gray hairs in the process :<

> I'll get around to adding a Fiber-based concurrency model which should
> work with TeeInput, too.

FiberSpawn and FiberPool have been added since and both seem to work
great.

Unconfirmed, but the IO.select()-based scheduler for these should also
give these a slight advantage when balancing between multiple worker
processes.

-- 
Eric Wong
_______________________________________________
Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
http://rubyforge.org/mailman/listinfo/rainbows-talk
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: HTML5 WebSockets
       [not found]     ` <20091210233236.GA23608-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
@ 2009-12-11  7:48       ` Eric Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Wong @ 2009-12-11  7:48 UTC (permalink / raw)
  To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw

Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org> wrote:
> The new version of Chrome supports Web Sockets, so yes, I'd like to
> confirm that our streaming "rack.input" support works with Web Sockets.

Reading the RFC[1] and the pywebsocket[2], it looks like
Transfer-Encoding: chunked is not used at all.  This means we'll have to
add an extension env instead of using "rack.input".

The good part about this is that we're no longer constrained by the
rewindable stream requirement, so there's no longer any need for
TeeInput nor filesystem I/O...

[1] - http://tools.ietf.org/id/draft-hixie-thewebsocketprotocol
[2] - http://code.google.com/p/pywebsocket/

> As always, I'm trying to avoid GUI development myself, but may end

Well, pywebsocket includes a command-line example client, so I'll just
develop with that and not have to deal with getting Chrome to run.

-- 
Eric Wong
_______________________________________________
Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
http://rubyforge.org/mailman/listinfo/rainbows-talk
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-11  7:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-24 19:24 HTML5 WebSockets Eric Wong
     [not found] ` <20091124192430.GA4965-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2009-12-10 23:32   ` Eric Wong
     [not found]     ` <20091210233236.GA23608-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2009-12-11  7:48       ` Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/rainbows.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).