https://github.com/douganderson444/compose-example
wasm-compose with shared state
https://github.com/douganderson444/compose-example
Last synced: 3 months ago
JSON representation
wasm-compose with shared state
- Host: GitHub
- URL: https://github.com/douganderson444/compose-example
- Owner: DougAnderson444
- Created: 2023-12-30T03:10:17.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-09T16:41:23.000Z (over 1 year ago)
- Last Synced: 2025-01-24T19:47:11.219Z (4 months ago)
- Language: Rust
- Homepage:
- Size: 2.58 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Compose a Wasm DAG
A simple Directed Acyclic Graph (DAG) component composition which shares a common `count` state.
There should only be one instance of the `count` state, and it should be shared between the `Increment` and `Show` components:
```mermaid
graph BT;
Count-->Increment;
Count-->Show;
Increment-->Aggregate;
Show-->Aggregate;
```## Compose
Build and compose the components:
```bash
cargo component build --workspace
wasm-tools compose --config config.yml --output aggregate.wasm target/wasm32-wasi/debug/aggregate.wasm
```## Test
The test is in the [`aggregate`](./crates/aggregate/tests/mod.rs) crate.
Run the test:
```bash
cargo test -p aggregate
```