pub struct AsyncTaskPlugin { /* private fields */ }Expand description
异步任务插件:基于 Semaphore 的并发控制后台任务队列
stop() 时会等待所有正在执行的任务完成后才返回。
Implementations§
Trait Implementations§
Source§impl Plugin for AsyncTaskPlugin
impl Plugin for AsyncTaskPlugin
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
启动插件:验证连接、初始化资源 Read more
Source§fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
关闭插件:释放资源 Read more
Source§fn depends_on(&self) -> &[&str]
fn depends_on(&self) -> &[&str]
依赖的其他插件名称(用于拓扑排序,保证启动顺序) Read more
Auto Trait Implementations§
impl Freeze for AsyncTaskPlugin
impl !RefUnwindSafe for AsyncTaskPlugin
impl Send for AsyncTaskPlugin
impl Sync for AsyncTaskPlugin
impl Unpin for AsyncTaskPlugin
impl UnsafeUnpin for AsyncTaskPlugin
impl !UnwindSafe for AsyncTaskPlugin
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