mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-26 06:42:48 +00:00
add links
This commit is contained in:
parent
5c1ebc22af
commit
c17778e358
1 changed files with 6 additions and 4 deletions
|
@ -43,7 +43,9 @@ impl FileWatcher for MyDatabase {
|
|||
}
|
||||
```
|
||||
|
||||
* We declare the query as a derived query (which is the default).
|
||||
* In the query implementation, we don't call any other query and just directly read file from disk.
|
||||
* Because the query doesn't read any inputs, it will be assigned a `HIGH` durability by default, which we override with `report_synthetic_read`.
|
||||
* The result of the query is cached, and we must call `invalidate` to clear this cache.
|
||||
- We declare the query as a derived query (which is the default).
|
||||
- In the query implementation, we don't call any other query and just directly read file from disk.
|
||||
- Because the query doesn't read any inputs, it will be assigned a `HIGH` durability by default, which we override with `report_synthetic_read`.
|
||||
- The result of the query is cached, and we must call `invalidate` to clear this cache.
|
||||
|
||||
A complete, runnable file-watching example can be found in [this git repo](https://github.com/ChristopherBiscardi/salsa-file-watch-example/blob/f968dc8ea13a90373f91d962f173de3fe6ae24cd/main.rs) along with [a write-up](https://www.christopherbiscardi.com/on-demand-lazy-inputs-for-incremental-computation-in-salsa-with-file-watching-powered-by-notify-in-rust) that explains more about the code and what it is doing.
|
||||
|
|
Loading…
Reference in a new issue