Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nsheff authored Feb 2, 2024
1 parent 9a84125 commit fd5d2b7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,20 @@ Change

```python
with ym as locked_ym:
locked_ym.write()
locked_ym.write()
```

to


```python
with write_lock(ym) as locked_ym:
locked_ym.write()
locked_ym.rebase()
locked_ym.write()
```

In the new system, you must use `rebase()` before `write()` if you want to allow for multiple processes to possibly have written the file since you read it in.



More examples:
Expand All @@ -88,10 +91,10 @@ ym["new_var"] = 15

with write(ym) as locked_ym:
locked_ym.rebase()
locked_ym.write()
locked_ym.write()

with read(ym) as locked_ym:
locked_ym.rebase()
locked_ym.rebase()

```

Expand Down

0 comments on commit fd5d2b7

Please sign in to comment.