flow

1 view
Skip to first unread message

ry

unread,
Aug 6, 2008, 3:40:11 PM8/6/08
to ebbebb, to...@medioh.com
hey
i wrote a new web server today. it only works on yarv and it requires
rev but it's mostly written in ruby (instead of c).

http://github.com/ry/flow/tree/master

it uses fibers and not threads. (maybe i'll add deferred requets
later)
it should handle chunked uploads (and soon chunked responses)
it does pipelined requests too, i think
but not ssl.

ryah

Dae San Hwang

unread,
Aug 7, 2008, 12:06:36 PM8/7/08
to ebb...@googlegroups.com
Ry, are you going to start new web server project every other week? ;)

I just tried out flow but got the following error.. Can you take a look?

/Users/daesan/flow/lib/flow.rb:136:in `initialize': undefined method
`shift' for #<String:0x6d69d8> (NoMethodError)
from /Users/daesan/flow/lib/flow.rb:71:in `new'
from /Users/daesan/flow/lib/flow.rb:71:in `process'
from /Users/daesan/flow/lib/flow.rb:61:in `block in on_request'

ry dahl

unread,
Aug 7, 2008, 1:04:56 PM8/7/08
to ebb...@googlegroups.com
> Ry, are you going to start new web server project every other week? ;)

while im unemployed - maybe :)

I was doing some non-standard rack stuff, but it should be normal now.

Dae San Hwang

unread,
Aug 7, 2008, 1:31:05 PM8/7/08
to ebb...@googlegroups.com
This time, I get the following error. I think it's because ruby 1.9
String doesn't support each method any more..

/Users/daesan/flow/lib/flow.rb:145:in `call': undefined method `each'
for #<String:0x6dd814> (NoMethodError)
from /Users/daesan/flow/lib/flow.rb:69:in `process'
from /Users/daesan/flow/lib/flow.rb:56:in `block in on_request'

ry dahl

unread,
Aug 7, 2008, 1:36:58 PM8/7/08
to ebb...@googlegroups.com
i think you shouldn't return strings from rack apps (anymore?)

from the rack spec:
> The Body must respond to each and must only yield String values.
> The Body commonly is an Array of Strings,
> the application instance itself, or a File-like object.

ryah

Dae San Hwang

unread,
Aug 7, 2008, 9:27:41 PM8/7/08
to ebb...@googlegroups.com
Ruby 1.8 string is enumerable and responds to 'each' while ruby 1.9
string is not enumerable and thus does not responds to 'each'.. By the
way, I do not understand why body needs to be splitted before the web
server sends the response. I guess it's there for the performance
reasons?

I fixed the problem (for now) just by wrapping body string with an
array. It works fine now. However, I get the following error
occasionally.

/Users/daesan/flow/lib/flow.rb:145:in `call': undefined method `each'

for #<String:0x433a28> (NoMethodError)


from /Users/daesan/flow/lib/flow.rb:69:in `process'
from /Users/daesan/flow/lib/flow.rb:56:in `block in on_request'

daesan

Dae San Hwang

unread,
Aug 7, 2008, 11:01:11 PM8/7/08
to ebb...@googlegroups.com
Following error occurs only when the browser request for "/
favicon.ico" so I think the problem is with my framework. I should
check my routing logic.
Reply all
Reply to author
Forward
0 new messages