What's the best way to organize worker processes in Rails?

前端 未结 4 1680
无人及你
无人及你 2020-12-23 17:49

I frequently have some code that should be run either on a schedule or as a background process with some parameters. The common element is that they are run outside the disp

4条回答
  •  有刺的猬
    2020-12-23 18:39

    I have a system that receives requests and then needs to call several external systems using web-services. Some of these requests take longer than a user can be expected to wait and I use an enterprise queuing system(activemq) to handle these requests.

    I am using the ActiveMessaging plugin to do this. This allows me to marshall the request and place it on a queue for asynchronous processing with access to the request data, however you will need to write a polling service if you want to wait for the response.

    I have seen Ryan Bates railscast on Starling and Workling and they look promising but I haven't used them.

提交回复
热议问题