Closed mattfysh closed 1 year ago
I believe the example and guidance on that particular page of docs is superceded by the addition of input gates to the Durable Object system. See: https://blog.cloudflare.com/durable-objects-easy-fast-correct-choose-three/
You should still use it (or an equivalent) for hydrating from an external source using fetch()
but it is no longer necessary for fetching from DO storage.
Oh good to know, thanks! Seem like they should update the docs to remove the recommendation, or at least highlight a valid use case for using it.
According to the docs it's recommended to use
blockConcurrencyWhile
, e.g.This ensures that while the object is being constructed, simultaneous requests don't come into the DO's methods - which may assume the memory has been hydrated from state storage