R
Delayed implementation of long-standing actionsOnce you're able to create a separate flow, you don't have to complete this operation. before send a response to the client. And it's for this to be done. priorities♪ As a canonal example of such actions, e-mails are usually sent, but you have some other nature that is not less appropriate.They have control over how many of these heavy tasks can be carried out in parallel and the number of queues may be set so that the system does not fall. Moreover, this number can be changed directly during work (this is more a matter of administration).Such turns are usually structured as follows:Got it. Repository of tasks♪ This may be a dedicated communications server (RabbitMQ), or may be a general-purpose data repository (Redis, PostgreSQL). There are tasks to be carried out.Got it. server (Worker, working process) that takes one of the records repository of tasks in line (a order may be imposed on the data repository but not necessarily) and fulfils what is written.Got it. Clientwhich adds the tapes Repository of tasks♪From modern reality from the Ruby ecosystem, I can say: https://github.com/rails/rails/tree/master/activejob - your own adapter. http://api.rubyonrails.org/classes/ActiveJob/QueueAdapters.html showed up in Rails 4.2. It is predicted that almost all functionality specific to specific realities is deep buried or inaccessible. https://github.com/mperham/sidekiq - the most popular option. Functions stored Redis♪ Targets are carried out specifically for this purpose. Supports nitty people like assignments for a given time.
Regrettably, it is true that the warriors take tasks from the vault and wipe them out there, so that one task cannot capture a number of warriors. If the process that performed the task fell down, the task would disappear. The solution is in a feeble version, but you understand. https://github.com/gocardless/hutch - A little known. In fact, it's a simplified client. RabbitMQthe message server. Simplified, i.e. opportunities, absolute minimum and communications are exchanged through the one topic exchange♪
Topic exchange It is not only possible to use the task line. Hutch is therefore not positioned as a set of tasks, but as a means of communication between services. https://github.com/chanks/que - a pretty new and interesting version. The tasks are stored in a separate postgreSQL table. May use all ACID guarantees on an equal footing with the rest of the data and change in transactions with them.
The "Zawat" of the tasks is done through the advisory lock(s) on which the OBD is not aware, the annex may clearly indicate that it wishes to treat them somehow. The locking shall be recorded at the level of the connection in the operational memory. If the compound dies, the lock will fall and the record will be available to others. There is also a problem: the entry of Que roarers with access to OBD through pgbouncer is not possible.There are others, of course. We can focus. http://api.rubyonrails.org/classes/ActiveJob/QueueAdapters.html ♪