diff options
author | Eric Wong <e@80x24.org> | 2014-08-27 00:33:51 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2014-08-27 00:35:14 +0000 |
commit | a92a773a6f080c5d640498c02f129122a9a0d76a (patch) | |
tree | 85236c7fc763ac5c882e64946b1467505a55a02e | |
parent | 80b50cf21d6ba0ba4415d43b8ab6603afb20ea55 (diff) | |
download | yahns-a92a773a6f080c5d640498c02f129122a9a0d76a.tar.gz |
the_metal: API change for serve -> call
ref: the_metal commit 26527612c7a227fa2b53dd7158408ae48d2c57ea "use `call` instead of `serve`"
-rw-r--r-- | examples/the_metal.rb | 4 | ||||
-rw-r--r-- | lib/yahns/the_metal.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/the_metal.rb b/examples/the_metal.rb index 94b4ef0..b88a665 100644 --- a/examples/the_metal.rb +++ b/examples/the_metal.rb @@ -5,13 +5,13 @@ require 'the_metal' # based on README.markdown in git://github.com/tenderlove/the_metal.git class Application - def serve req, res + def call req, res # TODO: to support persistent connections, we must have Content-Length # when write_head is called or have Transfer-Encoding: chunked # (in which case res.write must chunk for us) res.write_head 200, 'Content-Type' => 'text/plain' res.write "Hello World\n" - res.close + res.finish end end diff --git a/lib/yahns/the_metal.rb b/lib/yahns/the_metal.rb index 55621ec..4d96bb7 100644 --- a/lib/yahns/the_metal.rb +++ b/lib/yahns/the_metal.rb @@ -69,7 +69,7 @@ class Yahns::TheMetal # :nodoc: req = TheMetal::Request.new(env) out = OutSock.new(self, persist) res = TheMetal::Response.new(200, headers, out) - k.app.serve(req, res) # may raise during OutSock#write + k.app.call(req, res) # may raise during OutSock#write if wbuf = out.wbuf # we may need to wait for writability: |