Dec 16, 2008

Super fast action with Rails Metal

Josh commit a new feature into edge rails named Metal. With it ppl can use rack directly to serve request easily. Take a look at his example:

  # app/metal/poller.rb
class Poller <> "application/json"},
Message.recent.to_json]
else
super
end
end
end

* There is a generator to help you get started
`script/generate metal poller`

* Also, metal bits can be ran standalone with rackup
`rackup app/metal/poller.rb`

Not the request to 'http://your.app.com/poller' will be processed in rack, that's more faster than processing it in controller :)

No comments:

Post a Comment