Skip to content

Commit

Permalink
Followup on doc update from #26. (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
aebrahim authored Sep 12, 2024
1 parent b56f4a2 commit 821e4dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,13 @@ class MyClass:
### `per_thread`
This instantiates the function once per thread, and will return a thread-local
result for each separate thread. This is extremely convenient for expensive
objects which are not thread-safe.
objects which are not thread-safe. Under the hood, this uses `threading.local`
for its caching.

### `allow_reset`
This exposes a `reset` method on the function, which will force the underlying
function to be called again.
function to be called again. The reset acts at the same scope as the underlying
caching behavior, so a `per_thread` call will only act on that thread.
```python
@once.once(allow_reset=True)
def resettable_fn():
Expand Down

0 comments on commit 821e4dd

Please sign in to comment.