Struct wd_run::EventManage [−][src]
Implementations
impl<K> EventManage<K> where
K: Eq + Hash,
[src]
impl<K> EventManage<K> where
K: Eq + Hash,
[src]pub fn new(conf: EConfig) -> EventManage<K>
[src]
pub fn new(conf: EConfig) -> EventManage<K>
[src]在非async函数中创建
pub async fn new_async(conf: EConfig) -> EventManage<K>
[src]
pub async fn new_async(conf: EConfig) -> EventManage<K>
[src]异步创建
pub fn add<E>(&self, key: K, event: E, etype: EType) -> Result<(), String> where
E: 'static + Event + Sync + Send,
[src]
E: 'static + Event + Sync + Send,
pub fn add_async<E>(&self, key: K, event: E) -> Result<(), String> where
E: 'static + AsyncEvent + Send,
[src]
E: 'static + AsyncEvent + Send,
pub fn remove(&self, key: K) -> Result<(), String>
[src]
pub fn clear(&self) -> Result<(), String>
[src]
pub fn exec_sequence(&self, key: &K, ctx: Option<Context>) -> Result<(), String>
[src]
pub fn exec_sequence(&self, key: &K, ctx: Option<Context>) -> Result<(), String>
[src]按顺序执行,先注册的先执行,后注册的后执行。 同一时间一个注册方法只会有一个线程调用。 顺序执行事件,会受到上线文状态影响,失败状态则不再执行后去内容
pub async fn exec_sequence_async(
&'_ self,
key: &'_ K,
ctx: Option<Context>
) -> Result<(), String>
[src]
pub async fn exec_sequence_async(
&'_ self,
key: &'_ K,
ctx: Option<Context>
) -> Result<(), String>
[src]按顺序执行异步方法,先注册的先执行,后注册的后执行。 同一时间一个注册方法只会有一个线程调用。 顺序执行事件,会受到上线文状态影响,失败状态则不再执行后去内容 该方法在spawn中执行无法通过编译
pub async fn exec_immediately(&'_ self, key: &'_ K, ctx: Option<Context>)
[src]
pub async fn exec_immediately(&'_ self, key: &'_ K, ctx: Option<Context>)
[src]立即进行异步执行,速度更快,开启任务的开销较小
pub fn delay_exec<E>(&self, event: E, ctx: Context) where
E: 'static + Event + Sync + Send,
[src]
E: 'static + Event + Sync + Send,
pub fn delay_exec_async<E>(&self, event: E, ctx: Context) where
E: 'static + AsyncEvent + Send,
[src]
E: 'static + AsyncEvent + Send,
Auto Trait Implementations
impl<K> !RefUnwindSafe for EventManage<K>
impl<K> Send for EventManage<K> where
K: Send + Sync,
K: Send + Sync,
impl<K> Sync for EventManage<K> where
K: Send + Sync,
K: Send + Sync,