Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- access-log: /dev/null
- hosts:
- "localhost":
- listen: 8384
- paths:
- "/t":
- mruby.handler: |
- class Foo
- def initialize(ch, a)
- @ch = ch
- task do
- @ch.push a
- end
- end
- end
- Proc.new do |env|
- begin
- ch = H2O::Channel.new
- f1 = Foo.new(ch, "a")
- f2 = Foo.new(ch, "b")
- str = ''
- 2.times{ str << ch.shift }
- [200, {}, [str]]
- rescue => e
- puts "Unexpected error #{e.class}:#{e.message}"
- e.backtrace.each do |bt|
- puts "\t#{bt}"
- end
- [500, {}, [e.message]]
- end
- end
Add Comment
Please, Sign In to add comment