radicle-heartwood-lfs/radicle-node/src
Fintan Halpenny 985b0af3f6
radicle: implement caching for issues and patches
Implement caching for the `Issue` and `Patch` COB. This is achieved by
having the `Transaction::initial` and `Transaction::commit` methods
take a cache which can update the newly created/updated object. The
`Store::remove` method also takes the cache for removing the object
from the cache, as well as the repository.

This meant that the `*Mut` types for the respective COBs are required
to carry a cache alongside the repository store. Identities will not
be cached, and so this is always set to `NoCache` -- which performs no
caching, and always succeeds.

To perform cache reading for issues and patches, the `cache::Issues`
and `cache::Patches` traits are introduced. They capture the minimal
amount of methods that are needed for the `rad issue` and `rad patch`
CLI commands.

The implementor for each of these traits is there respective `Cache`
types, which combines their backing repository store and the SQLite
database. They both provide convenience methods:
- `create` (and `draft` for patches)
- `get_mut`
- `remove`
which can be used instead of their repository store counterparts.

All uses of the repository stores (where needed) are replaced with
`Cache` types.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-02-23 16:03:21 +01:00
..
runtime Rename `Id` to `RepoId` 2024-01-22 15:51:44 +01:00
service node: Make sure node is "active" when connected 2024-02-12 11:37:31 +01:00
test radicle: implement caching for issues and patches 2024-02-23 16:03:21 +01:00
tests node: Various small fixes 2024-02-12 11:37:31 +01:00
wire node: Various small fixes 2024-02-12 11:37:31 +01:00
worker radicle: implement caching for issues and patches 2024-02-23 16:03:21 +01:00
bounded.rs node: loosen BoundedVec::collect_from bounds 2023-11-17 16:09:42 +01:00
control.rs Rename `Id` to `RepoId` 2024-01-22 15:51:44 +01:00
deserializer.rs node: Implement protocol multiplexing 2023-04-10 14:41:55 +02:00
lib.rs Rename `Id` to `RepoId` 2024-01-22 15:51:44 +01:00
main.rs node: Increase process ulimit on start 2024-01-17 17:34:25 +01:00
runtime.rs radicle: implement caching for issues and patches 2024-02-23 16:03:21 +01:00
service.rs node: Various small fixes 2024-02-12 11:37:31 +01:00
signals.rs node: Handle `SIGINT` and `SIGTERM` properly 2023-02-14 13:28:16 +01:00
test.rs radicle: expose shared logger 2023-12-20 15:11:10 +01:00
tests.rs radicle: implement caching for issues and patches 2024-02-23 16:03:21 +01:00
wire.rs Rename `Id` to `RepoId` 2024-01-22 15:51:44 +01:00
worker.rs radicle: implement caching for issues and patches 2024-02-23 16:03:21 +01:00