more app message call

This commit is contained in:
John Smith
2022-09-30 22:37:55 -04:00
parent baa1714943
commit 046b61d5d8
15 changed files with 310 additions and 8 deletions

View File

@@ -10,15 +10,16 @@ struct ApiResult {
interface Registration {}
interface VeilidServer {
register @0 (veilidClient: VeilidClient) -> (registration: Registration, state: Text);
debug @1 (command: Text) -> (result :ApiResult);
register @0 (veilidClient :VeilidClient) -> (registration :Registration, state :Text);
debug @1 (command :Text) -> (result :ApiResult);
attach @2 () -> (result :ApiResult);
detach @3 () -> (result :ApiResult);
shutdown @4 ();
getState @5 () -> (result :ApiResult);
changeLogLevel @6 (layer: Text, logLevel: Text) -> (result :ApiResult);
changeLogLevel @6 (layer :Text, logLevel :Text) -> (result :ApiResult);
appCallReply @7 (id :UInt64, message :Data) -> (result :ApiResult);
}
interface VeilidClient {
update @0 (veilidUpdate: Text);
update @0 (veilidUpdate :Text);
}

View File

@@ -236,6 +236,25 @@ impl veilid_server::Server for VeilidServerImpl {
encode_api_result(&result, &mut results.get().init_result());
Promise::ok(())
}
#[instrument(level = "trace", skip_all)]
fn app_call_reply(
&mut self,
params: veilid_server::AppCallReplyParams,
mut results: veilid_server::AppCallReplyResults,
) -> Promise<(), ::capnp::Error> {
trace!("VeilidServerImpl::app_call_reply");
let id = pry!(params.get()).get_id();
let message = pry!(pry!(params.get()).get_message()).to_owned();
let veilid_api = self.veilid_api.clone();
Promise::from_future(async move {
let result = veilid_api.app_call_reply(id, message).await;
encode_api_result(&result, &mut results.get().init_result());
Ok(())
})
}
}
// --- Client API Server-Side ---------------------------------