I have a REST API, which returns a List of items to work on.
Every user of the application will receive the items, and will select one from it.
Now, I want to lock this work item for all other users, until either: the user who was working on it is done with work or they simply closed it.
So far, I have kept a locking mechanism, which just locks the item for 30 mins(a cron job unlocks on the basis of timestamp) by setting a flag in the database, and that item is not fetched in further calls.
But 30 mins of locking is way too long, and decreasing time will increase possibilities of conflicts. Any way to make this real-time?
So far, there are WebSockets which can be used to implement it. No ideas apart form that.
Aucun commentaire:
Enregistrer un commentaire