Multiple users on my NodeJS server accessing the same variable

0

I have a question about how a nodejs server works with multiple users. To contextualize:
Let's say I create a variable on the server side, will the value of that variable be overwritten if someone else also accesses the same route at the same time?

    
asked by anonymous 01.05.2018 / 23:21

1 answer

1

Imagine that there is only one run stream. When a request arrives, it goes into this stream, the Javascript virtual machine checks what has to be done, delegates the activity (queries data in the database, for example) and resumes requests again while this parallel processing > is happening. When the activity ends (we already have the data returned by the bank), it returns to the main stream to be returned to the requester.

Some links that can help you better understand node.js:

02.05.2018 / 01:10