pub struct ShardServiceClient<Stub = Channel<ShardServiceRequest, ShardServiceResponse>>(/* private fields */);Expand description
The client stub that makes RPC calls to the server. All request methods return Futures.
Implementations§
Source§impl ShardServiceClient
impl ShardServiceClient
Sourcepub fn new<T>(
config: Config,
transport: T,
) -> NewClient<Self, RequestDispatch<ShardServiceRequest, ShardServiceResponse, T>>
pub fn new<T>( config: Config, transport: T, ) -> NewClient<Self, RequestDispatch<ShardServiceRequest, ShardServiceResponse, T>>
Returns a new client stub that sends requests over the given transport.
Source§impl<Stub> ShardServiceClient<Stub>
impl<Stub> ShardServiceClient<Stub>
Sourcepub fn ingest_document(
&self,
ctx: Context,
doc: Document,
) -> impl Future<Output = Result<RpcResult<DocumentId>, RpcError>> + '_
pub fn ingest_document( &self, ctx: Context, doc: Document, ) -> impl Future<Output = Result<RpcResult<DocumentId>, RpcError>> + '_
Ingest a document into this shard.
The document will be processed by local agents during the next tick. Returns the document ID assigned to the ingested document.
Sourcepub fn tick_phase(
&self,
ctx: Context,
phase: TickPhase,
tick: u64,
) -> impl Future<Output = Result<RpcResult<PhaseResult>, RpcError>> + '_
pub fn tick_phase( &self, ctx: Context, phase: TickPhase, tick: u64, ) -> impl Future<Output = Result<RpcResult<PhaseResult>, RpcError>> + '_
Execute a tick phase on this shard.
Phases are executed in order: Sense -> Act -> Decay -> Advance. Each phase must complete on all shards before the next phase begins (barrier sync).
Sourcepub fn local_query(
&self,
ctx: Context,
req: LocalQueryRequest,
) -> impl Future<Output = Result<RpcResult<LocalQueryResult>, RpcError>> + '_
pub fn local_query( &self, ctx: Context, req: LocalQueryRequest, ) -> impl Future<Output = Result<RpcResult<LocalQueryResult>, RpcError>> + '_
Execute a local query (part of distributed query).
Returns matching nodes from this shard’s portion of the graph. Results are combined by the coordinator using scatter-gather.
Sourcepub fn get_term_frequencies(
&self,
ctx: Context,
terms: Vec<String>,
) -> impl Future<Output = Result<RpcResult<HashMap<String, u64>>, RpcError>> + '_
pub fn get_term_frequencies( &self, ctx: Context, terms: Vec<String>, ) -> impl Future<Output = Result<RpcResult<HashMap<String, u64>>, RpcError>> + '_
Get term frequencies for global DF computation.
Returns a map of term -> document frequency for TF-IDF calculation. Used during global DF aggregation for TF-IDF scoring.
Sourcepub fn get_node(
&self,
ctx: Context,
id: NodeId,
) -> impl Future<Output = Result<RpcResult<Option<NodeData>>, RpcError>> + '_
pub fn get_node( &self, ctx: Context, id: NodeId, ) -> impl Future<Output = Result<RpcResult<Option<NodeData>>, RpcError>> + '_
Fetch a node’s full data (for ghost node resolution).
Used when a shard needs detailed information about a node that exists on another shard.
Sourcepub fn health_check(
&self,
ctx: Context,
) -> impl Future<Output = Result<RpcResult<ShardHealth>, RpcError>> + '_
pub fn health_check( &self, ctx: Context, ) -> impl Future<Output = Result<RpcResult<ShardHealth>, RpcError>> + '_
Health check.
Returns the current health status of this shard including resource usage and processing statistics.
Sourcepub fn resolve_ghost_nodes(
&self,
ctx: Context,
node_ids: Vec<NodeId>,
) -> impl Future<Output = Result<RpcResult<Vec<GhostNode>>, RpcError>> + '_
pub fn resolve_ghost_nodes( &self, ctx: Context, node_ids: Vec<NodeId>, ) -> impl Future<Output = Result<RpcResult<Vec<GhostNode>>, RpcError>> + '_
Resolve cross-shard edges by fetching ghost node data.
Batch operation to fetch data for multiple nodes at once, creating ghost node representations for cross-shard edges.
Sourcepub fn get_neighbors(
&self,
ctx: Context,
node_id: NodeId,
) -> impl Future<Output = Result<RpcResult<Vec<NodeId>>, RpcError>> + '_
pub fn get_neighbors( &self, ctx: Context, node_id: NodeId, ) -> impl Future<Output = Result<RpcResult<Vec<NodeId>>, RpcError>> + '_
Get the list of nodes connected to a given node.
Returns node IDs of all neighbors, including cross-shard references.
Sourcepub fn receive_signals(
&self,
ctx: Context,
signals: Vec<CrossShardSignal>,
) -> impl Future<Output = Result<RpcResult<()>, RpcError>> + '_
pub fn receive_signals( &self, ctx: Context, signals: Vec<CrossShardSignal>, ) -> impl Future<Output = Result<RpcResult<()>, RpcError>> + '_
Receive cross-shard signals during the Exchange phase.
Signals from other shards are delivered here for local processing.
Trait Implementations§
Source§impl<Stub: Clone> Clone for ShardServiceClient<Stub>
impl<Stub: Clone> Clone for ShardServiceClient<Stub>
Source§fn clone(&self) -> ShardServiceClient<Stub>
fn clone(&self) -> ShardServiceClient<Stub>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more