pub struct ResolverRead(/* private fields */);Expand description
Client for querying the resolver server (read operations).
Used by subscribers to resolve paths to publisher addresses, list published paths, and query the namespace structure. Handles referrals and cluster topology automatically.
Implementations§
Source§impl ResolverRead
impl ResolverRead
pub fn new(default: Config, desired_auth: DesiredAuth) -> Self
Sourcepub async fn send(
&self,
batch: &GPooled<Vec<ToRead>>,
) -> Result<(GPooled<IntMap<PublisherId, Publisher>>, GPooled<Vec<FromRead>>)>
pub async fn send( &self, batch: &GPooled<Vec<ToRead>>, ) -> Result<(GPooled<IntMap<PublisherId, Publisher>>, GPooled<Vec<FromRead>>)>
Send the specified messages to the resolver and return answers in send order.
Sourcepub async fn resolve<I>(
&self,
batch: I,
) -> Result<(GPooled<IntMap<PublisherId, Publisher>>, GPooled<Vec<Resolved>>)>where
I: IntoIterator<Item = Path>,
pub async fn resolve<I>(
&self,
batch: I,
) -> Result<(GPooled<IntMap<PublisherId, Publisher>>, GPooled<Vec<Resolved>>)>where
I: IntoIterator<Item = Path>,
Resolve the specified paths to publisher addresses.
Results are in send order.
Sourcepub async fn list(&self, path: Path) -> Result<GPooled<Vec<Path>>>
pub async fn list(&self, path: Path) -> Result<GPooled<Vec<Path>>>
List immediate children of the specified path.
Order is unspecified.
Sourcepub async fn list_matching(
&self,
globset: &GlobSet,
) -> Result<GPooled<Vec<GPooled<Vec<Path>>>>>
pub async fn list_matching( &self, globset: &GlobSet, ) -> Result<GPooled<Vec<GPooled<Vec<Path>>>>>
List all paths in the cluster matching the specified globset.
Returns a list of batches of paths. If your globset is configured to match only published paths, then the batches should be disjoint, otherwise there may be some duplicate structural elements.
Sourcepub async fn check_changed(&self, tracker: &mut ChangeTracker) -> Result<bool>
pub async fn check_changed(&self, tracker: &mut ChangeTracker) -> Result<bool>
Check whether there have been any changes under the specified path.
This checks all servers in the resolver cluster. A change in this context consists of:
- A new publisher publishing an existing path
- A publisher publishing a new path
- A publisher no longer publishing a path
Changes to the value of already published paths is not a change in this context.
This method is meant to be used as a light alternative to
list, or list_matching in order to discover when structural
changes are made by publishers that result in the need to
adjust subscriptions. It is much cheaper and faster to call
this method than list or list_matching.
The first call with a new ChangeTracker will always result
in true. If true is returned at any point it is not a
guarantee that there were changes, but it is a strong
possibility. If false is returned it is guaranteed that
there was no change.
Sourcepub async fn table(&self, path: Path) -> Result<Table>
pub async fn table(&self, path: Path) -> Result<Table>
Interpret path as a table and return it’s description.
The contents of the resolver server is a tree, however a tree’s structure can describe a table if at a single level multiple paths are published that share common children. Then each level 1 path is a row, and the common children are the columns.
§Example
/table/a/1
/table/a/2
/table/b/1
/table/b/2is a table with two rows, a and b, and two columns 1 and 2.
Trait Implementations§
Source§impl Clone for ResolverRead
impl Clone for ResolverRead
Source§fn clone(&self) -> ResolverRead
fn clone(&self) -> ResolverRead
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more