more app message call
This commit is contained in:
@@ -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);
|
||||
}
|
@@ -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 ---------------------------------
|
||||
|
Reference in New Issue
Block a user