Alp
Alp
CDCloudflare Developers
Created by Alp on 9/30/2023 in #workers-help
Can we use `blockConcurrencyWhile` inside `fetch` method of a Durable Object?
Scenario; There is a single instance of a durable object responsible only for registering users. This durable object puts user data into a KV namespace. Only this durable object writes to this KV namespace. First, it reads KV if the user already exists and then writes. To avoid race, can I use blockConcurrencyWhile inside fetch? I know that durable objects already have transactional storage but I need to write data to KV namespace, that is used by other workers as read-only. I only see blockConcurrencyWhile used in durable object initialization that's why I ask.
25 replies