This commit is contained in:
dr-frmr 2023-11-02 12:48:22 -04:00
parent 7f64a06609
commit bbfeb418bd
No known key found for this signature in database
3 changed files with 9 additions and 23 deletions

View File

@ -17,7 +17,6 @@ cargo-component-bindings = { git = "https://github.com/bytecodealliance/cargo-co
serde = {version = "1.0", features = ["derive"] }
serde_json = "1.0"
wit-bindgen = { version = "0.11.0", default_features = false }
uqbarprocesslib = { path = "../../uqbar-process-lib" }
[lib]
crate-type = ["cdylib"]

View File

@ -14,7 +14,11 @@ struct Component;
impl Guest for Component {
fn init(_: Address) {
println!("Don't run this, run the app!");
print_to_terminal(0, "don't run this!");
std::thread::sleep(std::time::Duration::from_millis(3000));
set_on_panic(&OnPanic::None);
}
}

View File

@ -123,27 +123,10 @@ impl UqProcessImports for ProcessWasi {
// process management:
//
/// todo -> move to kernel logic to enable persistence etc.
async fn set_on_panic(&mut self, _on_panic: wit::OnPanic) -> Result<()> {
unimplemented!();
// let on_panic = match on_panic {
// wit::OnPanic::None => t::OnPanic::None,
// wit::OnPanic::Restart => t::OnPanic::Restart,
// wit::OnPanic::Requests(reqs) => t::OnPanic::Requests(
// reqs.into_iter()
// .map(|(addr, req, payload)| {
// (
// de_wit_address(addr),
// de_wit_request(req),
// de_wit_payload(payload),
// )
// })
// .collect(),
// ),
// };
// self.process.metadata.on_panic = on_panic;
// Ok(())
/// TODO critical: move to kernel logic to enable persistence of choice made here
async fn set_on_panic(&mut self, on_panic: wit::OnPanic) -> Result<()> {
self.process.metadata.on_panic = de_wit_on_panic(on_panic);
Ok(())
}
/// create a message from the *kernel* to the filesystem,