mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-21 10:30:41 +08:00
node: Test control socket
Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use crate::client::handle;
|
||||
use crate::client::handle::traits;
|
||||
use crate::{client, identity, protocol};
|
||||
|
||||
#[derive(Default, Clone)]
|
||||
pub struct Handle {
|
||||
pub updates: Arc<Mutex<Vec<identity::ProjId>>>,
|
||||
}
|
||||
|
||||
impl traits::Handle for Handle {
|
||||
fn updated(&self, id: identity::ProjId) -> Result<(), handle::Error> {
|
||||
self.updates.lock().unwrap().push(id);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn command(&self, _cmd: protocol::Command) -> Result<(), handle::Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn shutdown(self) -> Result<(), client::handle::Error> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user