jeudi 26 août 2021

What is the best way to implement user Live status management on web?

I have a scenarion.

  1. My users logged in my project and current status = available
  2. If users getting task , your status = on working
  3. My task dispatcher sends jobs to whoever is "available" in the system at that moment.
  4. I keep users status in mysql
  5. But sometimes 2 tasks are assigned to the user at the same time.
  6. Because when the second task starts to be assigned before the status is updated in mysql, that user sees it as "available".

For example;

  1. task 2021-08-25 is dispatching at 10:00:01.
  2. task 2021-08-25 is dispatching at 10:00:02.

But same user

How can I handle this situation ? Waiting for your suggestions

Backend : PHP Laravel Database : Mysql




Aucun commentaire:

Enregistrer un commentaire