On the site I am currently working on, we would like to reserve all items in a basket upon a user adding/removing an item to the basket.
At which point if the user makes no further additions or subtractions to his basket after a set period of time, the items will be unreserved.
I know this could be achieved by giving each stock quantity a DateTime of when it was last reserved (the last time the basket was updated) and refreshing that time on every basket update.
Then setting a scheduled task for very minute going through all stock quantities and if they are more than X old they can be unreserved and added back in to main stock.
Is this the best way to achieve this or is there a more elegant solution than a scheduled task.
I am using MVC , and Azure for hosting (which has a task scheduler, not that I have explored whether it can perform this sort of task)
Implemented the solution i thought was possible (Giving each item a "Last Modified" field and then using azure task scheduler , ran an action that processed all those with a datetime outside of a certain range. )
Seems to work fine.