Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement HolonServiceApi for the ClientHolonService in the client_shared_objects module of the holons_client crate. Each trait method: #214

Open
9 tasks
Tracked by #206
nphias opened this issue Feb 6, 2025 · 0 comments

Comments

@nphias
Copy link
Collaborator

nphias commented Feb 6, 2025

  • builds the appropriate DanceRequest
  • asks the Conductor to call the dance function on the dances zome (encapsulate this in a private helper method)
  • processes the DanceResponse and returns results
pub trait HolonServiceApi: Debug {
    /// This function commits the staged holons to the persistent store
    fn commit(&self, context: &dyn HolonsContextBehavior) -> Result<CommitResponse, HolonError>;

    fn delete_holon(&self, holon_id: &HolonId) -> Result<(), HolonError>;

    fn fetch_holon(&self, id: &HolonId) -> Result<Holon, HolonError>;

    fn fetch_related_holons(&self, source_id: &HolonId,  relationship_name: &RelationshipName, ) 
        -> Result<HolonCollection, HolonError>;

    fn fetch_all_populated_relationships(&self, source_id: HolonId, ) 
        -> Result<Rc<RelationshipMap>, HolonError>;
}

Implementation Notes:

  • commit method delegates to existing commit_dance
  • delete_holon delegates to delete_holon_dance
  • fetch_holon delegates to get_holon_by_id_dance
  • fetch_related_holons delegates to query_relationships_dance
  • fetch_all_populated_relationships doesn't yet have a dance defined. The client implementation can just return a
  • HolonError(NotImplemented) for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant