Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by cartellonegerardo · May 02 at 06:20 PM · Player Datadataentities

How to block data operations on player objects until azure function finished?

I have an azure function that does a getObjectAsyn then a setObjectsAsync on the objects of a player, I want other azure functions that want to perform operations on the data of the same player objects to wait until my initial azure function is done before they perform their operations on the objects of that player.

The whole purpose of this is to simply make sure functions don't use data that is in the process of being changed.

for example: let's say I have an object with data = 100

If two azur functions that want to manipulate the data of that object are called nearly at the same time one is going to call, getObjectAsyn and will get data = 100 then the other is going to call getObjectAsyn and the data will also be 100. Let's say my azure functions add 1 to the data.

the first azure function will then finish and call SetObjectsAsync setting the object data value to 100+1=101 and the second azure function will also set the object data to 101 when ideally I would like the value to be 102 at the end.

Thanks for any help.

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by SethDu · May 03 at 02:02 AM

PlayFab doesn't provide file lock features, but in terms of Entity Objects, each update will increase the ProfileVersion by 1, hence it is noticeable if it is target version and Azure Function can perform updating or rejecting based on the ProfileVersion.

A queue trigger Azure Function can also be useful to handle this and if advanced features are required, an external database is preferred.

Comment
cartellonegerardo

People who like this

1 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    11 People are following this question.

    avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

    Related Questions

    Where to store Minecraft-like world data? 1 Answer

    Looking for a viable way to save our mutiple json files. 1 Answer

    Storing custom game data specific to a player (card game example),Inventory management data structure in a card like game 1 Answer

    Size of entity data (how much can 500 bytes fit?) 2 Answers

    Best way to store large amount of JSON objects 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges