Answer the question
In order to leave comments, you need to log in
What is the difference between the way nodejs, python and php work?
Hello!
I began to study nodejs, before that I worked only with PHP and a little with Python from the server-side Java.
These technologies work a little differently, but I'm not sure if I understand everything correctly. I will explain with my fingers how I understood their work, and you, please correct me if I'm wrong.
So PHP and Python work in the same way: a request comes in and the web server transfers the execution of the request to the PL handler.
That is a script like this:
i = 1;
print(i);
i++;
i = 1;
server.on('connection', () => {
print(i);
i++;
});
$i = 1;
while (true) {
$data = getData();//Каким-то образом принимать данные извне
send(i);
$++;
}
Answer the question
In order to leave comments, you need to log in
PHP, Python, NodeJS, Go, Java - they all know how to work as daemons, regularly.
And all of them can be made to work in the script run mode for each request.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question