Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: FL03 <jo3mccain@icloud.com>
  • Loading branch information
FL03 committed Feb 25, 2024
1 parent d14b7cf commit 5f34d86
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
14 changes: 10 additions & 4 deletions contained/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ test = false
default = ["core", "music", "turing"]
full = ["core", "music", "turing"]

core = ["contained-core"]
music = ["contained-music"]
turing = ["contained-turing"]
core = [
"dep:contained-core"
]
music = [
"dep:contained-music"
]
turing = [
"dep:contained-turing"
]

[lib]
bench = true
Expand All @@ -42,7 +48,7 @@ contained-turing = { features = [], optional = true, path = "../turing", version
anyhow.workspace = true
async-trait.workspace = true
bytes.workspace = true
decanter = { features = ["derive"], version = "0.1.5" }
decanter = { features = ["derive"], version = "0.1.6" }
futures.workspace = true
glob = "0.3"
lazy_static = "1"
Expand Down
14 changes: 7 additions & 7 deletions contained/src/agents/layer/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@
use super::OneshotSender;
use crate::music::neo::LPR;
use crate::prelude::BoxedWasmValue;
// use decanter::prelude::H256;
use decanter::prelude::H256;
use wasmer::Imports;

#[derive(Debug)]
pub enum Command {
Execute {
module: String,
module: H256,
function: String,
args: BoxedWasmValue,
with: Option<Imports>,
tx: OneshotSender<BoxedWasmValue>,
},
Include {
bytes: Vec<u8>,
tx: OneshotSender<String>,
tx: OneshotSender<H256>,
},
Transform {
id: String,
id: H256,
dirac: LPR,
tx: OneshotSender,
},
}

impl Command {
pub fn execute(
module: String,
module: H256,
function: String,
args: BoxedWasmValue,
with: Option<Imports>,
Expand All @@ -49,10 +49,10 @@ impl Command {
tx,
}
}
pub fn include(bytes: Vec<u8>, tx: OneshotSender<String>) -> Self {
pub fn include(bytes: Vec<u8>, tx: OneshotSender<H256>) -> Self {
Self::Include { bytes, tx }
}
pub fn transform(id: String, dirac: LPR, tx: OneshotSender) -> Self {
pub fn transform(id: H256, dirac: LPR, tx: OneshotSender) -> Self {
Self::Transform { id, dirac, tx }
}
}
6 changes: 3 additions & 3 deletions contained/src/cluster/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
Description: The stack is a collection of modules and environments that are availible to the cluster
*/
use crate::agents::VirtualEnv;
// use decanter::prelude::H256;
use decanter::prelude::H256;
use std::collections::HashMap;
use std::sync::{Arc, RwLock};
use wasmer::Module;

pub struct Stack {
pub envs: Arc<RwLock<HashMap<String, VirtualEnv>>>,
pub modules: Arc<RwLock<HashMap<String, Module>>>,
pub envs: Arc<RwLock<HashMap<H256, VirtualEnv>>>,
pub modules: Arc<RwLock<HashMap<H256, Module>>>,
}

impl Stack {
Expand Down

0 comments on commit 5f34d86

Please sign in to comment.