Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event #3

Open
matianfu opened this issue Apr 16, 2015 · 1 comment
Open

Event #3

matianfu opened this issue Apr 16, 2015 · 1 comment

Comments

@matianfu
Copy link
Owner

为什么需要实现Event可以写一本书;

简单的说Event x State就是程序行为的完备数学定义;两者都是程序的Nature;简化的Event是轮循外部变量的语句;简化的State就在if/while等分支语句里;他们可以简化但不会没有;

Event对于FUNK意味着什么呢?

FUNK并非真正的Blocking;再次调用的时候,如果在恢复运行之前做一点小小的检查工作再决定是否继续,Well,就完全等价于Event模式下的EventLoop入口的GetEvent动作;

真正的代码可能写在两个不同的地方,一个是FUNK的goto之前;另一个是goto之后、再次调用sub-FUNK之前,两者用途和形式都会有区别;很可能Event会引起这一层状态机的路径变化,但也可能只有某个subFunk阻塞时关注某个Event;

设计上也有两个原则,一个是在全局的FUNK设计里引入Event机制,但这对那些不需要Event的FUNK来说可能会带来书写代码的负担;

这里还需要仔细考虑再做定夺;

@matianfu
Copy link
Owner Author

Won't implement in near future. Unless you have some strong reason to present.

Anyway, you can always pass something through arguments, so why we need a uniform mechanism for all FUNKs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant