I’d like to create a command processor on the backend of a rails application and make it accessible in some way outside of the browser. So, for example, it might listen for connections on a particular port, or might watch a named pipe, or something else. This part is irrelevant.
The relevant part is that it needs access to models but needs to be outside of the standard Rails flow (i.e., http request to controller). So, the command processor might receive the command “start job 10”, and it should be able to update the database through the Rails app models, and possible also send results email through an ActionMailer. In other words, it would do everything your normal ActionController would do, without be started in response to an HTTP request.
Where is the proper place to put this within a rails application, and how would I make it capable of accessing my models?