host: expose harness state and actions over the world API
This commit is contained in:
@@ -120,6 +120,8 @@ pub async fn run_with_userland(
|
||||
crate::process::default_script(),
|
||||
Some(api.clone()),
|
||||
)?;
|
||||
let (sender, receiver) = crate::harness::input::channel();
|
||||
api.attach_harness(sender.clone());
|
||||
let listener = Listener::start_with_api(api, options)?;
|
||||
runtime
|
||||
.network_policy()
|
||||
@@ -129,7 +131,13 @@ pub async fn run_with_userland(
|
||||
tokio::runtime::Builder::new_current_thread()
|
||||
.enable_all()
|
||||
.build()?
|
||||
.block_on(crate::harness::run_console(world, Arc::new(runtime), cred))
|
||||
.block_on(crate::harness::run_console_with_input(
|
||||
world,
|
||||
Arc::new(runtime),
|
||||
cred,
|
||||
sender,
|
||||
receiver,
|
||||
))
|
||||
})
|
||||
.await
|
||||
.map_err(anyhow::Error::from)
|
||||
|
||||
Reference in New Issue
Block a user