Skip to content

feat(host): add HostServices for guest calls back to the host #281

Description

@DamianReeves

Part of finos/morphir#958, phase D (finos/morphir#962). Split out of #237, which closed with the rest of the session layer in #275.

What

Let a guest call back to its host for logging, progress and reading files. No JSON-RPC guest calls the host today, so this lands with the component imports in phase D.

  • Channel::receive carries guest requests and notifications as well as responses.
  • JsonRpcConnection runs a dispatch loop: while it waits for a response, it hands guest requests and notifications to the host.
  • A client-supplied HostServices trait in morphir-host (log, progress, read_file), portable to wasm32 like the rest of the crate.
  • The Extism host functions in morphir-host-native (morphir_log and the workspace and cache functions) are bound to the same trait instead of today's stubs.

Done when

  • A guest notification or request reaches a HostServices implementation through JsonRpcConnection, pinned by a fake-channel test.
  • An Extism guest's host-function call reaches the same trait.
  • morphir-host still checks on wasm32-unknown-unknown.

Design

Host library spec (beads morphir-opua.1, design), section on HostServices. Tracked in beads: morphir-opua.1.4.5.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions