+1 vote
by
Good afternoon
I am interested in this question
I use WP, but it is not very useful information and does not make much difference here
Noda is not used in this project
The task is to make some background process in javascript
This process includes a function that constantly performs some kind of operation
In simple terms, when you enter a page, it activates javascript which performs some actions all the time while someone is on the page
But we need to make this script run all the time without direct user involvement
That is, you have to run it once and never touch it again.
Thanks in advance for the answer
by
Bavashi How safe is it?
by
Vladimir the script authorizes a certain person in a certain system and then becomes a permanent handler of certain events
namely, receiving calls
starting on a timer is not an option
We need a process that works all the time.
by
Vladimir , executed independently of the user so the webworker is not an option

2 Answers

0 votes
by
 
Best answer
What does the script do? Modifies the base via API? Changes the page? Outputs notifications?
Is it acceptable for each person who is currently logged in to the site to run this script?
This phrase
Simply put, when you enter a page, it activates javascript which performs some actions all the time until someone is on the pageBut you have to make this script run all the time without the users themselves
Very controversial. Should the script be executed when the page is accessed or without user input?

So read about webworker, but note that it is also a client javascript, and it runs in the user's browser
https://developer.mozilla.org/en-US/docs/Web/API/W...

Well, if you need the ability to update, for example, a catalog of products with a push from the server and provide offline work can look at
https://developer.mozilla.org/en-US/docs/Web/API/S...
0 votes
by
It is standard practice to start a timer. Every few milliseconds it will do something. You can check out Yandex metrics, they clutter up the whole debugging area
...