pub struct DreamProcess { /* private fields */ }Expand description
The Dream process — 4-phase background memory consolidation.
Runs automatically on a timer (default: every 24 hours) or can be triggered manually. Uses checkpointing for crash recovery.
Implementations§
Source§impl DreamProcess
impl DreamProcess
Sourcepub fn new(
memory_manager: Arc<MemoryManager>,
config: DreamConfig,
space_dir: PathBuf,
) -> Self
pub fn new( memory_manager: Arc<MemoryManager>, config: DreamConfig, space_dir: PathBuf, ) -> Self
Create a new DreamProcess.
Sourcepub fn should_dream(
&self,
last_dream: Option<DateTime<Utc>>,
sessions_since: u32,
) -> bool
pub fn should_dream( &self, last_dream: Option<DateTime<Utc>>, sessions_since: u32, ) -> bool
Check if a dream should run now based on configuration.
Sourcepub async fn dream(&self) -> DreamReport
pub async fn dream(&self) -> DreamReport
Run the full 4-phase dream process.
Returns a DreamReport with statistics about what was done.
Sourcepub fn spawn_dream_task(self: &Arc<Self>)
pub fn spawn_dream_task(self: &Arc<Self>)
Spawn the dream as a background task.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DreamProcess
impl !RefUnwindSafe for DreamProcess
impl !UnwindSafe for DreamProcess
impl Send for DreamProcess
impl Sync for DreamProcess
impl Unpin for DreamProcess
impl UnsafeUnpin for DreamProcess
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more