later
later copied to clipboard
dynamic tasks consult
i have a Business Scenario like this
users.forEach(async (x) => {
await updateUserInfo(x);
later.setInterval(async () => {
await updateUserInfo(x);
}, later.parse.recur().every(random(50, 70)).second());
});
update each user status info every 50-70s.(Worry about performance if all tasks are 60s)
Questions:
- if there is a new user, how to startup a new task?
- if there a large amount of users (like 10k+), it's there a better way?