brokerd: state.sock answers memoryd's question about a session's state
Co-Authored-By: ornith-1.5-35b-a3b <agent@wntrmute.dev>
This commit is contained in:
@@ -25,12 +25,14 @@ impl Default for Paths {
|
||||
}
|
||||
}
|
||||
|
||||
/// An empty path means "the default under `home`".
|
||||
/// The sockets `brokerd` serves. An empty path means "the default under `home`".
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Default)]
|
||||
#[serde(deny_unknown_fields, default)]
|
||||
pub struct Sockets {
|
||||
pub broker: PathBuf,
|
||||
pub admin: PathBuf,
|
||||
/// `memoryd`'s session-state questions (M5c spec, section 7).
|
||||
pub state: PathBuf,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
|
||||
@@ -284,6 +286,14 @@ impl Config {
|
||||
self.sockets.admin.clone()
|
||||
}
|
||||
}
|
||||
/// `state.sock`, where `memoryd` asks for a session's state.
|
||||
pub fn state_socket(&self) -> PathBuf {
|
||||
if self.sockets.state.as_os_str().is_empty() {
|
||||
self.paths.home.join("run/memory-broker/state.sock")
|
||||
} else {
|
||||
self.sockets.state.clone()
|
||||
}
|
||||
}
|
||||
/// `gateway.sock`, when `[gateway]` is set.
|
||||
pub fn gateway_socket(&self) -> Option<PathBuf> {
|
||||
let gateway = self.gateway.as_ref()?;
|
||||
|
||||
Reference in New Issue
Block a user