Mountain/RPC/CocoonService/FileSystem/WatchFile.rs
1#![allow(non_snake_case)]
2
3//! Register a file watcher. TODO(P1): wire `notify` and store the
4//! handle in `ApplicationState.Feature.Watchers` so `cancel_operation`
5//! can stop it.
6
7use tonic::{Response, Status};
8
9use crate::{
10 RPC::CocoonService::CocoonServiceImpl,
11 Vine::Generated::{Empty, WatchFileRequest},
12 dev_log,
13};
14
15pub async fn Fn(_Service:&CocoonServiceImpl, Request:WatchFileRequest) -> Result<Response<Empty>, Status> {
16 let URI = Request.uri.as_ref().map(|U| U.value.as_str()).unwrap_or("");
17 dev_log!(
18 "cocoon",
19 "[CocoonService] watch_file registered (polling not yet active): {}",
20 URI
21 );
22 Ok(Response::new(Empty {}))
23}