I’ve heard of the various background task tools (delayed_job, starling, workling, etc) but from looking at those it seems they’re really only capable of running model-based methods (User.update_counters, for example).
I need to be able to run a controller method as it’s a pretty complex set of tasks that’s intertwined a slew of other controller methods and custom classes.
It’s a CPU intensive process that can take ~5-10 minutes to run so I’d like it to run without interfering with “normal” site operations from other users.
Am I misunderstanding how those other tools work? Or is there something else I’m not considering?
The accepted way of doing things is to move all your complex logic in to the model and have the controller only to direct the requests and responses. This is what “Fat models and skinny controllers” theory says. Move the complex logic in to a model class (that doesn’t necessary be an ActiveRecord class) and may be you can have a rake task to be called by a background tool.