Created
December 30, 2019 19:09
-
-
Save ericl/ed1dce20d310b86c0dc5540ae991494b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Idempotent actor API example. | |
1. Actors go from PENDING -> CREATED -> [RECONSTRUCTING -> CREATED] -> DEAD | |
2. A single client may issue multiple updates, it is important these updates aren't re-ordered. | |
This can be handled by making the actor update calls idempotent. | |
Non-idempotent: | |
def AsyncUpdate(actor_id, actor_state) | |
Idempotent: | |
def SetActorPendingIfNotExists(actor_id) | |
def SetActorCreatedAtVersion(actor_id, actor_lifetime_version) # version is 0, 1, 2, 3 etc. | |
def SetActorDeadAtVersion(actor_id, actor_lifetime_version) # suppressed if version already past | |
The GCS server can simply ignore requests that are "overwritten" by more recent versions. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment