Respond to RPC pings in the server

This commit is contained in:
Antonio Scandurra
2021-09-09 11:08:41 +02:00
parent ad7631de9f
commit 34d8f99714
+13
View File
@@ -92,6 +92,7 @@ impl Server {
};
server
.add_handler(Server::ping)
.add_handler(Server::share_worktree)
.add_handler(Server::join_worktree)
.add_handler(Server::update_worktree)
@@ -244,6 +245,18 @@ impl Server {
worktree_ids
}
async fn ping(self: Arc<Server>, request: TypedEnvelope<proto::Ping>) -> tide::Result<()> {
self.peer
.respond(
request.receipt(),
proto::Pong {
id: request.payload.id,
},
)
.await?;
Ok(())
}
async fn share_worktree(
self: Arc<Server>,
mut request: TypedEnvelope<proto::ShareWorktree>,