a classic hello world example from their doc,
class HelloWorld
def call(env)
return [200, {}, ["Hello world!"]]
end
end
my question is why the third value is [Hello world!"], not "Hello world"? From their doc,
The Body must respond to each and must only yield String values. The Body itself should not be an instance of String, as this will break in Ruby 1.9.
Why body needs to respond to each? and in what case does it matter?
I think rack originated on python's wsgi. Here is the explanation for python: http://www.python.org/dev/peps/pep-3333/#buffering-and-streaming
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With