add links

This commit is contained in:
Christopher Biscardi 2020-11-01 12:23:17 -08:00
parent 5c1ebc22af
commit c17778e358

View file

@ -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.