Skip to content

Commit eb92f48

Browse files
committed
Update readme
1 parent 72a24b0 commit eb92f48

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

resource_locking/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Resource Locking Sample
22

3-
This sample shows how to use a long-lived `LockManagerWorkflow` to ensure that each `resource` is used by at most one
4-
`ResourceLockingWorkflow` at a time. `ResourceLockingWorkflow` runs several activities while it has ownership of a
5-
resource.
3+
This sample shows how to use a long-lived `LockManagerWorkflow` to allocate `resources` to `ResourceLockingWorkflows`.
4+
Each`ResourceLockingWorkflow` runs several activities while it has ownership of a resource. Note that
5+
`LockManagerWorkflow` is making resource allocation decisions based on in-memory state.
66

77
Run the following from this directory to start the worker:
88

9-
poetry run python worker.py
9+
uv run worker.py
1010

11-
This will start the worker. Then, in another terminal, run the following to execute several load workflows:
11+
This will start the worker. Then, in another terminal, run the following to execute several `ResourceLockingWorkflows`.
1212

13-
poetry run python starter.py
13+
uv run starter.py
1414

1515
You should see output indicating that the LockManagerWorkflow serialized access to each resource.
1616

@@ -36,6 +36,7 @@ signals. Locking carries a risk where failure to unlock permanently removing a r
3636
Temporal's durable execution guarantees, this can only happen if:
3737

3838
- A LoadWorkflow times out (prohibited in the sample code)
39+
- An operator terminates a LoadWorkflow. (Temporal recommends canceling workflows instead of terminating them whenever possible.)
3940
- You shut down your workers and never restart them (unhandled, but irrelevant)
4041

4142
If a leak were to happen, you could discover the identity of the leaker using the query above, then:

0 commit comments

Comments
 (0)