cloudflavor / skyforge

The WASI plugins, the spec and the registry used by skyforge plugins.
Apache License 2.0
0 stars 0 forks source link

SDK: Add graph dependency for resource creation #20

Open PI-Victor opened 3 months ago

PI-Victor commented 3 months ago

Context

Some resources are dependent on others to be created first, and so they need to be added in a graph to create them in the right order.

Description

The SDK needs a graph dependecy macro that can generate all the implementation for the resources that they need.

Ideas: It could be done in such a way where the user adds the resources for creation in a builder like pattern such that the top ones are created first.

Just a first idea how this could look like:

let cidr = Cidr {};
let network = Network {};

let resources = tree::build()
        .with_dependency(cidr)
        .with_dependency(network)
        .build();

Which would get built in the background by a macro into a dep graph.

Acceptance Criteria

We can defined the order of resource creation using a builder pattern, a macro or something to that effect, that the user can then simply use to define the order of any generic resources that they want to create.

/triage /assign /label enhancement

linear[bot] commented 3 months ago

CLO-87 SDK: Add graph dependency for resource creation