Skip to content

Uniform API Dispatch Design Options

Steve Melville edited this page May 7, 2024 · 1 revision

Design Options

This page explores two design options:

  • Option 1: Internal Dispatch
  • Option 2: Conductor Dispatch

Option 1: Internal Dispatch

Under this option the Uniform API consists of a single externalized function: dance(request:DanceRequest)->ExternResult<DanceResponse> that can be invoked via the Conductor's call zome function. All differences between dances are encapsulated within the DanceRequest and DanceResponse objects.

  • The code that implements the Dance is written in Rust within a holochain zome.
  • A dispatch_table is used to map a dance name to the Rust function that implements that dance
  • the population of this dispatch_table is the tricky part -- if statically defined -- how will we support dynamic addition of apps to AgentSpaces?

Option 2: Conductor Dispatch

Under this option the Uniform API is defined by a function pattern, rather than a single function:

`xxx_dance(request:DanceRequest)->ExternResult<DanceResponse>`

Each such function is independently callable via the Conductor call zome API. Implementations of these functions will perform some standard initialization functions (e.g., creating the HolonsContext) via helper functions before executing their implemented behavior.

Design Sketch (Option 1)

Option 1 is the current target for the initial implementation.

Clone this wiki locally