args working

This commit is contained in:
Drew Tada 2024-01-16 16:37:49 -06:00
parent 27ff968fc1
commit 5d74293678
2 changed files with 15 additions and 3 deletions

View File

@ -272,11 +272,15 @@ fn handle_run(
// }
// }
// }
Request::new()
let _ = Request::new()
.target(("our", "kernel", "sys", "nectar"))
.body(serde_json::to_vec(&kt::KernelCommand::RunProcess(
parsed_new_process_id,
parsed_new_process_id.clone(),
))?)
.send_and_await_response(5)??;
let _ = Request::new()
.target(("our", parsed_new_process_id))
.body(args.into_bytes())
.send();
Ok(())
}

View File

@ -1,4 +1,4 @@
use nectar_process_lib::{await_message, call_init, println, Address, Request};
use nectar_process_lib::{await_message, call_init, println, Address, Message, Request};
wit_bindgen::generate!({
path: "wit",
@ -12,4 +12,12 @@ call_init!(init);
fn init(our: Address) {
println!("{}: this is a dummy script!", our);
// TODO will need to package this up into a process lib function that makes it easy
let Ok(Message::Request { body, .. }) = await_message() else {
println!("got send error, failing out");
return;
};
println!("here are the args: {:?}", String::from_utf8(body));
}