218 releases
new 0.5.0-dev.6 | Nov 20, 2024 |
---|---|
0.5.0-dev.3 | Oct 30, 2024 |
0.4.0-dev.15 | Jul 31, 2024 |
0.3.0-beta-dev.42 | Mar 27, 2024 |
0.0.2 | Jul 29, 2021 |
#135 in Magic Beans
1,305 downloads per month
Used in 8 crates
(via holochain)
2.5MB
56K
SLoC
holochain_cascade
Cascade
Retrieve vs Get
Get checks CRUD metadata before returning an the data where as retrieve only checks that where the data was found the appropriate validation has been run.
lib.rs
:
The Cascade is a multi-tiered accessor for Holochain DHT data.
Note that the docs for this crate are admittedly a bit loose and imprecise, but they are not expected to be incorrect.
It is named "the Cascade" because it performs "cascading" gets across multiple sources. In general (but not in all cases), the flow is something like:
- First attempts to read the local storage
- If that fails, attempt to read data from the network cache
- If that fails, do a network request for the data, caching it if found
Retrieve vs Get
There are two words used in cascade functions: "get", and "retrieve". They mean distinct things:
- "get" ignores invalid data, and sometimes takes into account CRUD metadata before returning the data, so for instance, Deletes are allowed to annihilate Creates so that neither is returned. This is a more "refined" form of fetching data.
- "retrieve" only fetches the data if it exists, without regard to validation status. This is a more "raw" form of fetching data.
Dependencies
~73–110MB
~2M SLoC