Storage Transactions/Locks


Is there any type of implementation for transactions or locks on the storage?

My problem currently is, I want to read from storage to check if a bot is currently playing any match (we have user bots), if it isnt create a ticket for the bot so a real user can match with the bot.

Problem is, between reading from storage and the bot and user matching, that same bot could have been matched already.

Is there any way to implement something like this?

Hello @BernardoSantos,

You should use conditional writes - before you create the ticket you should attempt to update the storage object holding the bot status using the version field from your storage read. If this fails it means that the object has since been updated, and the data you had read is outdated.


I will give it a go.