C
C
crdrads2019-01-30 13:39:15
Node.js
crdrads, 2019-01-30 13:39:15

How to emit an event from a separate process?

There is a web application on Node / Express / Socket.io
When performing a difficult operation, I connect the Bull task queue, which creates a separate process for the task. But now it’s not clear how I can send an event to the client who sent the initial request from this task-process?

socket.io.emit(`imageprocessing:${job.id}`, finaleResult)

This does not work from a separate process. Apparently because the process does not know which client to send? Do I need to re-raise the websocket server separately in this process (for example, I had to re-raise the connection to Monge there) How to fix it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question