-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
暴露BusinessHandle
发送消息依赖于结构体BusinessHandle,但是该结构体位于core下,不方便解耦
type MessageSender = Arc<mania::core::business::BusinessHandle>;
// ^___ module is private下面是例子
// mod p1
struct A {}
//^__声明为私有
pub fn get_a()->A{
return A{};
}// mod p2
fn test(){
let a_entity = get_a();
func_with_a_param(a_entity);
}
fn func_with_a_param(a:A){}
// ^__ 无法传值
fn func_with_dyn(a:Box<dyn ATrait>){}
trait ATrait{}
impl ATrait for A {
// ^___ 无法通过封装结构体及实现特性的方式传值
}为GroupEvent实现Clone/Copy派生
处理消息同时执行协程代码时,由于GroupEvent底层被RwLockReadGuard保护,无法越过线程边界(await)进行上下文切换
同时,由于GroupEvent没有实现Clone/Copy派生,无法通过RwLock或mpsc::channel发送
由于没有实现Clone/Copy派生,提升了代码的耦合度及降低了程序的灵活性
关于manim的一些建议
作为机器人短时间内处理消息有限,或许可以在牺牲一部分性能的情况下提升编码体验
pk5ls20
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers