Permalink
Browse files

Close stream, now.

  • Loading branch information...
1 parent 12ae111 commit 9699345427ef0348be62a926065be996fedb1896 @tekacs tekacs committed Jun 1, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 stream.rb
View
9 stream.rb
@@ -14,6 +14,13 @@ def response(env)
env.stream_send(".\n")
end
- [200, {}, Goliath::Response::STREAMING]
+ EM.add_timer(10) do
+ keepalive.cancel
+
+ env.stream_send("End of stream.")
+ env.stream_close
+ end
+
+ [200, {'Content-Type' => 'text/plain'}, Goliath::Response::STREAMING]
end
end

0 comments on commit 9699345

Please sign in to comment.