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

Timer Enhancement #2498

Merged
merged 18 commits into from
Apr 15, 2019
Merged

Timer Enhancement #2498

merged 18 commits into from
Apr 15, 2019

Conversation

twose
Copy link
Member

@twose twose commented Apr 10, 2019

建议在v4.4.0考虑合并

PHP层

  • 增加Timer::clearAll(), 由底层API暴露而来, 提供清除所有PHP定时器的能力
  • 增加Timer::list(), 及相关类Timer\Iterator, 提供迭代所有PHP定时器的能力
  • 增加Timer::info(int $timer_id), 提供获取定时器信息的能力
  • 增加Timer::stats(), 提供获取全局定时器信息的能力

底层

  • 增加swHashMap_rewind重置hashmap迭代器指针, 更规范 (底层目前所有迭代都是一轮完整的循环, 实际上暂无作用)
  • 增加SW_FUNCTION_ALIAS, 支持动态注册函数别名, 旨在收敛模块相关代码到模块所属的c文件中(而不是在全局c文件和头文件)
  • 梳理了模块加载的顺序排列, 更清晰
  • tnode.remove 属性改名为 tnode. removed, 和swConnectionremoved一致
  • php定时器的C API应该以 php_swoole_timer 打头(总是以模块名打头, 而不是先方法+模块名)
    enum swBool_type php_swoole_timer_clear(swTimer_node *tnode);
    enum swBool_type php_swoole_timer_clear_all();

其它

  • 补充了相关单元测试和增强了原有测试

@twose
Copy link
Member Author

twose commented Apr 10, 2019

Request review: @windrunner414 @mabu233 @caohao-php

src/core/hashmap.c Outdated Show resolved Hide resolved
src/core/hashmap.c Outdated Show resolved Hide resolved
@matyhtf matyhtf merged commit 3116923 into master Apr 15, 2019
@twose twose deleted the timer-iterator branch April 19, 2019 06:36
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

Successfully merging this pull request may close these issues.

3 participants