memoryd: recall asks Honcho after the local index, outside the state lock
Co-Authored-By: ornith-1.5-35b-a3b <agent@wntrmute.dev>
This commit is contained in:
@@ -24,6 +24,22 @@ pub const SOURCE_WAIT: Duration = Duration::from_secs(5);
|
||||
/// The line in place of Honcho's items when the query holds a known-prefix secret.
|
||||
pub const SECRET: &str = "honcho: not asked; the query looks like it holds a secret";
|
||||
|
||||
/// What `recall` reads in Honcho: the sources, the owner's peer, and each source's limit
|
||||
/// (`SOURCE_WAIT` in `memoryd`).
|
||||
pub struct Reading {
|
||||
pub readers: Arc<Readers>,
|
||||
pub owner: String,
|
||||
pub wait: Duration,
|
||||
}
|
||||
|
||||
impl Reading {
|
||||
/// `recall`'s answer from the local index's items and Honcho's: `search`, then `answer`.
|
||||
pub fn recall(&self, local: Local, args: &RecallArgs, log: &Log) -> Recalled {
|
||||
let searched = search(&self.readers, &self.owner, args, self.wait, log);
|
||||
answer(local, &args.query, args.k, searched)
|
||||
}
|
||||
}
|
||||
|
||||
/// What the Honcho part found.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Searched {
|
||||
|
||||
Reference in New Issue
Block a user