Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

feat!(kv): Adds caching option for the interface client #55

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

thomastaylor312
Copy link
Contributor

This PR does several things and contains several breaking changes:

  • All deprecated methods have now been removed. This means we no longer support the old method of getting linkdefs and claims via control topics
  • The function signatures for getting links and claims have changed to not use the old nested types. As part of this, nested types have been removed as well.
  • To support both cached and uncached clients, the Client and ClientBuilder types now have a generic T parameter. In practice this shouldn't actually affect most consumers, but will break those who are embedding it inside of other structs

Obviously the biggest feature add here is that we now have a client option that allows you to cache all of the linkdefs and claims locally. This is already done in several wasmcloud projects (like the host and wadm) and so it made sense to just centralize this logic. The default client still does a direct request to the key value bucket so consumers like wash don't have to take the time to do the initial load of the entire cache

I have bumped the crate to be an rc.1 because I want to make sure this is thoroughly tested in at least wadm (and preferrably the host) before cutting a full version

src/kv/mod.rs Outdated Show resolved Hide resolved
src/kv/mod.rs Outdated Show resolved Hide resolved
src/kv/mod.rs Outdated Show resolved Hide resolved
src/kv/direct.rs Show resolved Hide resolved
This PR does several things and contains several breaking changes:

- All deprecated methods have now been removed. This means we no longer support
  the old method of getting linkdefs and claims via control topics
- The function signatures for getting links and claims have changed to not
  use the old nested types. As part of this, nested types have been removed
  as well.
- To support both cached and uncached clients, the `Client` and `ClientBuilder`
  types now have a generic `T` parameter. In practice this shouldn't actually
  affect most consumers, but will break those who are embedding it inside of
  other structs

Obviously the biggest feature add here is that we now have a client option that
allows you to cache all of the linkdefs and claims locally. This is already done
in several wasmcloud projects (like the host and wadm) and so it made sense to
just centralize this logic. The default client still does a direct request to
the key value bucket so consumers like `wash` don't have to take the time to
do the initial load of the entire cache

I have bumped the crate to be an rc.1 because I want to make sure this is
thoroughly tested in at least wadm (and preferrably the host) before cutting
a full version

Signed-off-by: Taylor Thomas <taylor@cosmonic.com>
@thomastaylor312 thomastaylor312 merged commit 8ecb129 into wasmCloud:main Sep 15, 2023
@thomastaylor312 thomastaylor312 deleted the feat/cache branch September 15, 2023 23:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants