A
A
Alexander Petrov2017-11-14 17:14:53
Ruby on Rails
Alexander Petrov, 2017-11-14 17:14:53

Why is faye blocking delayed_job?

Situation.
Site on ruby ​​on rails. There are sockets with faye and delayed tasks with delayed_job support.
Problem following:
In delayed_job the task which launches a method in model is created.
In the method, a letter is sent by the socket:

require 'eventmachine'
      EM.run {
        client = Faye::Client.new('https://pervichka.pro/faye')
        client.publish('/notification/'+user.id.to_s, 'id' => notification.id)
      }

This code blocks delaed_job. it stops and doesn't work anymore. What to do?
The following is written in the locked_by field: delayed_job host:MacBook-Pro-Alexander.local pid:23796
I'm not a theorist, so maybe I didn't describe something correctly, sorry. I hope I got the point right)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Demidenko, 2017-11-14
@Mirkom63

EM.stop

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question