Re-using crontrollers with non-http requests

I'll let someone with more experience respond to that, but wouldn't it make sense (and be ultimately cleaner) to refactor those methods out of the controller(s) into application.rb?

FWIW,

Hassan Schroeder wrote:

Controllers are designed (in MVC patterns) to process requests and deliver responses. Rails-based controllers are designed for HTTP request/ response. The answer is to make your own controller that answers your agents’ responses.

Take advantage of Ruby here - take common code OUT of the controllers and put it into modules. Include the modules into your controllers, then make your own listener class that also mixes those models in. Use a daemon to keep that listener going. Railscasts.com has a nice screencast on daemons.

How does that sound?

Thanks Brian for this!

That sounds good! A lot of work, but good, thanks for this!

julien

Brian Hogan wrote: