examples/worker.rb in grenache-ruby-http-0.1.2 vs examples/worker.rb in grenache-ruby-http-0.1.3
- old
+ new
@@ -10,10 +10,11 @@
Signal.trap("TERM") { EventMachine.stop }
c = Grenache::Http.new
c.listen('test', 5004) do |env|
- req = Oj.load(env['rack.input'].read)
- [200,nil,"hello #{req}"]
+ body = env['rack.input'].read
+ req = Grenache::Message.parse(body)
+ "hello #{req.payload}"
end
end