How do I make a background process?
I'm interested in this question.
I use WP, but this is not very useful information and does not really matter here.
Node is not used in this project.
This process includes a function that constantly performs certain operations.
But you need to make sure that this script is executed constantly without the participation of direct users.
that is, you need to start it once and not touch it again.
What does the script do? Modifies the base via the API? Changing the page? Displaying notifications?
Is it permissible for every person who has visited the site to execute this script?
Here is the phrase
But you need to make sure that this script is executed constantly without the participation of users directly
Very controversial. Should the script be executed upon entering the page or without user intervention?
https://developer.mozilla.org/en-US/docs / Web / API / W ...
Well, if you need the ability to update, for example, the catalog of goods by pushing from the server and provide offline work, you can look at
https://developer.mozilla.org/en-US/docs/Web / API / S ...Anonymous
It is standard practice to start a timer. Once in how many milliseconds there it will do something. You can spy on Yandex metrics, they litter the entire debugging areaAnonymous
To place the code, please use CodePen or similar tool. Thanks you!