I
I
Ivan Zmerzlyi2017-02-14 11:07:27
Amazon Web Services
Ivan Zmerzlyi, 2017-02-14 11:07:27

How to write a Worker that will periodically perform a task?

The essence of the task, there are 10 users, you need to send them a Push Notification one by one, in the application the user sees a question that can be answered Yes or No or does not answer at all.
Regardless of the answer, after the time set for the worker, he will check the database if there is an answer?
If the question has an answer, the worker exits, if not, it sends a Push Notification to the next one in the list.
What is the best way to implement the work of such a worker?
The use of setTimeout suggests itself, but I'm not sure about the reliability of such a solution.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
emp1re, 2017-02-14
@emp1re

https://github.com/node-schedule/node-schedule

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question