Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
64 changes: 22 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resolver = "2"

members = [
"mudu",
"mudu_sys",
"mudu_adapter",
"mudu_type",
"mudu_contract",
Expand Down Expand Up @@ -36,6 +37,7 @@ test_utils = { path = "test_utils" }
sys_interface = { path = "sys_interface" }
mudu_adapter = { path = "mudu_adapter" }
mudu = { path = "mudu" }
mudu_sys = { path = "mudu_sys" }
mudu_binding = { path = "mudu_binding" }
md-5 = { version = "0.11.0-rc.0" }
sql_parser = { path = "sql_parser" }
Expand Down
1 change: 0 additions & 1 deletion doc/cfg/mududb_cfg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ http_worker_threads = 1
pg_listen_port = 5432

# Enable the WASI component runtime used by the new backend.
enable_p2 = true
enable_async = true

# 0 = Legacy
Expand Down
4 changes: 2 additions & 2 deletions example/game-backend/src/generated/game_object.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Clone)]
pub struct GameObject {
pub id : u64,
}
pub id: u64,
}
18 changes: 6 additions & 12 deletions example/game-backend/src/generated/instance.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
use crate::generated::game_object::GameObject;
use std::cell::RefCell;
use std::collections::HashMap;
use crate::generated::game_object::GameObject;

thread_local! {
static MAP:RefCell<HashMap<u64, GameObject>> = RefCell::new(HashMap::new());
}


struct Instance {

}

struct Instance {}

impl Instance {
pub fn put(id:u64, object:GameObject) {
pub fn put(id: u64, object: GameObject) {
MAP.with(|m| {
m.borrow_mut().insert(id, object);
})
}

pub fn get(id:u64) -> Option<GameObject> {
MAP.with(|m| {
m.borrow().get(&id).cloned()
})
pub fn get(id: u64) -> Option<GameObject> {
MAP.with(|m| m.borrow().get(&id).cloned())
}
}
}
4 changes: 2 additions & 2 deletions example/game-backend/src/generated/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub mod procedure;
mod game_object;
mod instance;
mod instance;
pub mod procedure;
Loading
Loading