pub struct RebuildActor { /* private fields */ }Expand description
Single-threaded actor that processes property-FTS rebuild requests one at a time. Shutdown is cooperative: drop the sender side to close the channel, then join the thread.
The RebuildActor owns the JoinHandle only. The SyncSender lives in
crate::admin::AdminService so the service can enqueue rebuild requests
directly without going through the runtime. The channel is created by
[RebuildActor::create_channel] and the two halves are distributed by
crate::runtime::EngineRuntime::open.
Implementations§
Source§impl RebuildActor
impl RebuildActor
Sourcepub fn start(
path: impl AsRef<Path>,
schema_manager: Arc<SchemaManager>,
receiver: Receiver<RebuildRequest>,
) -> Result<Self, EngineError>
pub fn start( path: impl AsRef<Path>, schema_manager: Arc<SchemaManager>, receiver: Receiver<RebuildRequest>, ) -> Result<Self, EngineError>
Create the mpsc channel used to communicate with the rebuild thread.
Returns (sender, actor). The sender is given to
crate::admin::AdminService; the actor is kept in
crate::runtime::EngineRuntime for lifecycle management.
§Errors
Returns EngineError::Io if the thread cannot be spawned.