Skip to content

Commit

Permalink
Fix wording in documentation of Durable Object blockConcurrencyWhile (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
a-robinson authored Sep 26, 2024
1 parent e2b6fb1 commit 54f5d07
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ If the callback throws an exception, the object will be terminated and reset. Th

`state.blockConcurrencyWhile()` takes effect right away, pausing everything else, other than the currently executing event and any I/O started from within the `state.blockConcurrencyWhile()` callback. The value returned by the callback becomes the value returned by `state.blockConcurrencyWhile()` itself.

To simulate eviction, use `state.blockConcurrencyWhile()`. Inside the callback, throw an exception. Throwing an exception causes the system to recreate the in-memory object, without affecting the durable storage. Uncaught exceptions inside the `state.blockConcurrencyWhile()` will break the actor.
To simulate eviction, use `state.blockConcurrencyWhile()`. Inside the callback, throw an exception. Throwing an exception causes the system to recreate the in-memory object, without affecting the durable storage. Uncaught exceptions inside the `state.blockConcurrencyWhile()` will break the object.

To help prevent deadlocks in your critical section, there is a 30s timeout on the callback passed into `state.blockConcurrencyWhile`. When this timeout is exceeded, your Durable Object will be reset. It is generally good practice to have your critical section in `blockConcurrencyWhile()` be as brief as possible.

0 comments on commit 54f5d07

Please sign in to comment.