Skip to content

Commit d2a003d

Browse files
26.2.23 stuff
1 parent 8cfa49c commit d2a003d

File tree

4 files changed

+2100
-1798
lines changed

4 files changed

+2100
-1798
lines changed

developer-guide/09-Storage and the filesystem/01-data-stores/local_storage.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,26 @@ Here's an example:
1212
from pioreactor.utils import local_intermittent_storage, local_peristant_storage
1313

1414

15-
with local_intermittent_storage("my_namespace2") as cache:
15+
with local_intermittent_storage("my_namespace") as cache:
1616
cache['key'] = "value"
1717
print(cache['key'])
1818

19+
cache.get("retrieval_key")
1920

20-
with local_peristant_storage("my_namespace1") as cache:
21+
22+
with local_peristant_storage("my_other_namespace") as cache:
2123
cache['key'] = "value"
24+
print(cache['key'])
25+
26+
assert cache.get("retrieval_key") is None
2227

2328

2429
```
2530

26-
You can use `pio view-cache <name>` to view the contents of `<name>`, and `pio clear-cache <name> <key>` to clear contents.
31+
You can use `pio cache view <name>` to view the contents of `<name>`, and `pio cache purge <name> <key>` to clear contents.
2732

2833
### What's the difference between `local_intermittent_storage` and `local_peristent_storage`?
2934

3035
`local_intermittent_storage` is data that won't, or shouldn't, exist after a reboot. For example: the state of GPIO pins. At a hardware level, this is reset after each reboot, and so should data associated with it.
3136

32-
Whereas `local_peristant_storage` is data that should exist between reboots. This is data like calibration data, or OD blank data.
37+
Whereas `local_peristant_storage` is data that should exist between reboots. This is data like some calibration data, or OD blank data.

0 commit comments

Comments
 (0)