I
I
Ilya78rus2015-03-11 00:04:14
PHP
Ilya78rus, 2015-03-11 00:04:14

How to link node.js to php site?

Hello
I would like to ask you for help.
There is a site and node.js that are on vps
How can I link the site with node.js
Let's say. The site writes data to mysql and sends them (For example: id, name)
Node.js receives them, performs manipulations and after the successful completion of the process sends a request to the site (id, name, true) for example with the same get request and, accordingly, this data further are recorded in the database
. And such manipulations are carried out not once, but at intervals from 1 minute to several days, i.e. I don't know when I'll have to do it again

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2015-03-11
Protko @Fesor

Organize a data bus on which RabbitMQ/ZeroMQ. And that's it. PHP publishes a message to the queue - node processes - publishes another message to another queue - PHP receives.

P
Philipp, 2015-03-11
@zoonman

Interaction can be done using both regular GET / POST requests, and using shared resources like a shared database or Redis. With Redis, everything will be easier, because. The node can work with the event model.
Here is your example https://simplapi.wordpress.com/2012/04/13/redis-pu...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question