Composing two components programmatically #1443
-
Hi! I want to use the I tried looking through the source to see if there's a nicer way, but I'm finding it hard to follow. Is there a simple way to take two components and compose them together? Cheers, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I think you've found what the The original author of |
Beta Was this translation helpful? Give feedback.
Hi @taybenlor. I'm happy to help with the
wasm-compose
API.The
ComponentComposer
is simplistic and is essentially a wrapper aroundCompositionGraph
(which is the flexible primitive for composing components together) geared towards the CLI experience; it expects a configuration for figuring out how to compose components together and that everything to compose exists on disk.With the
CompositionGraph
, however, you can compose together components either defined entirely in memory or read from disk. The basic concept for this API is that you "add" components to the graph so that the graph is aware of them, and then create instances (nodes in the graph) and connect (i.e. create an edge) betw…