pub struct TaskManager {
pub cache_service: Arc<CacheService>,
/* private fields */
}Fields§
§cache_service: Arc<CacheService>Implementations§
Source§impl TaskManager
impl TaskManager
Sourcepub fn new(
db: &DbHandle,
cache_service: Arc<CacheService>,
cookie_service: Option<Arc<CacheService>>,
config: Arc<RwLock<Config>>,
) -> Self
pub fn new( db: &DbHandle, cache_service: Arc<CacheService>, cookie_service: Option<Arc<CacheService>>, config: Arc<RwLock<Config>>, ) -> Self
Creates a task manager with repository, factory, and module assembler wiring.
Narrowed dependencies: only a DB handle + cache / cookies / config are needed (it used to
take the entire Arc<State> — refactor Phase 2).
With db = None (or without the store feature) it enters no-DB mode, synthesizing tasks
from the in-memory module registry.
Sourcepub async fn add_module(&self, work: Arc<dyn ModuleTrait>)
pub async fn add_module(&self, work: Arc<dyn ModuleTrait>)
Registers one module implementation.
Sourcepub async fn add_modules(&self, works: Vec<Arc<dyn ModuleTrait>>)
pub async fn add_modules(&self, works: Vec<Arc<dyn ModuleTrait>>)
Registers multiple module implementations.
Sourcepub async fn exists_module(&self, name: &str) -> bool
pub async fn exists_module(&self, name: &str) -> bool
Returns true when module name is registered.
Sourcepub async fn remove_work(&self, name: &str)
pub async fn remove_work(&self, name: &str)
Unregisters module by name.
Sourcepub async fn remove_by_origin(&self, origin: &Path)
pub async fn remove_by_origin(&self, origin: &Path)
Removes all modules loaded from a given origin path.
Sourcepub async fn module_names(&self) -> Vec<String>
pub async fn module_names(&self) -> Vec<String>
Returns all registered module names.
Sourcepub async fn set_origin(&self, names: &[String], origin: &Path)
pub async fn set_origin(&self, names: &[String], origin: &Path)
Tags module names with origin path for hot-reload bookkeeping.
Sourcepub async fn load_with_model(&self, task_model: &TaskEvent) -> Result<Task>
pub async fn load_with_model(&self, task_model: &TaskEvent) -> Result<Task>
Loads task from TaskModel and synchronizes initial state.
Sourcepub async fn load_parser(&self, parser_model: &TaskParserEvent) -> Result<Task>
pub async fn load_parser(&self, parser_model: &TaskParserEvent) -> Result<Task>
Loads task from ParserTaskModel with historical state restoration.
Sourcepub async fn load_error(&self, error_model: &TaskErrorEvent) -> Result<Task>
pub async fn load_error(&self, error_model: &TaskErrorEvent) -> Result<Task>
Loads task from ErrorTaskModel and applies error accounting.
Sourcepub async fn load_with_response(&self, response: &Response) -> Result<Task>
pub async fn load_with_response(&self, response: &Response) -> Result<Task>
Loads task context from response metadata.
Sourcepub async fn load_module_with_response(
&self,
response: &Response,
) -> Result<(Arc<Module>, Option<LoginInfo>)>
pub async fn load_module_with_response( &self, response: &Response, ) -> Result<(Arc<Module>, Option<LoginInfo>)>
Loads resolved module and optional login info for parser flow.
Sourcepub async fn clear_factory_cache(&self)
pub async fn clear_factory_cache(&self)
Clears internal factory caches.
Sourcepub async fn get_all_modules(&self) -> Vec<Arc<dyn ModuleTrait>>
pub async fn get_all_modules(&self) -> Vec<Arc<dyn ModuleTrait>>
Returns all registered module implementations.
Auto Trait Implementations§
impl !RefUnwindSafe for TaskManager
impl !UnwindSafe for TaskManager
impl Freeze for TaskManager
impl Send for TaskManager
impl Sync for TaskManager
impl Unpin for TaskManager
impl UnsafeUnpin for TaskManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more