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

pool: TaskPool 实现 #50 #57

Merged
merged 17 commits into from
Aug 31, 2022
Merged

Commits on Aug 27, 2022

  1. pool: TaskPool 实现 ecodeclub#50

    TaskPool管理有限状态机,TaskExecutor负责启动任务,优雅关闭,强制退出等操作
    
    Signed-off-by: longyue0521 <longyueli0521@gmail.com>
    longyue0521 committed Aug 27, 2022
    Configuration menu
    Copy the full SHA
    0b47349 View commit details
    Browse the repository at this point in the history
  2. 修复ShutdownNow data race问题

    Signed-off-by: longyue0521 <longyueli0521@gmail.com>
    longyue0521 committed Aug 27, 2022
    Configuration menu
    Copy the full SHA
    6687548 View commit details
    Browse the repository at this point in the history
  3. 处理注释等问题

    Signed-off-by: longyue0521 <longyueli0521@gmail.com>
    longyue0521 committed Aug 27, 2022
    Configuration menu
    Copy the full SHA
    340cb26 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1edcb79 View commit details
    Browse the repository at this point in the history
  5. 修改CHANGELOG.md

    longyue0521 committed Aug 27, 2022
    Configuration menu
    Copy the full SHA
    9c67a25 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2022

  1. Configuration menu
    Copy the full SHA
    0886d38 View commit details
    Browse the repository at this point in the history
  2. 修复因使用go1.19导致的atomic.Int32类型为定义问题

    处理Task.Run返回的error,fmt.Println可能导致并发问题
    
    Signed-off-by: longyue0521 <longyueli0521@gmail.com>
    longyue0521 committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    eb2e93a View commit details
    Browse the repository at this point in the history
  3. 重构TaskPool并整理测试

    Signed-off-by: longyue0521 <longyueli0521@gmail.com>
    longyue0521 committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    29fa358 View commit details
    Browse the repository at this point in the history
  4. 修改.CHANGELOG.md

    Signed-off-by: longyue0521 <longyueli0521@gmail.com>
    longyue0521 committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    f2649ff View commit details
    Browse the repository at this point in the history
  5. Merge branch 'dev' into feature/TaskPool

    Signed-off-by: Longyue Li <longyueli0521@gmail.com>
    longyue0521 committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    1e3eb5a View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2022

  1. 1.将time.After替换为time.Sleep

    2.将Task运行时抛出的panic接住并封装为error返回
    longyue0521 committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    7979415 View commit details
    Browse the repository at this point in the history
  2. 1.显示检查queue是否被关闭

    2.处理Start/Shutdown/ShutdownNow()重复调用问题
    3.Submit方法中只检验task==nil的情况
    longyue0521 committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    63b4265 View commit details
    Browse the repository at this point in the history
  3. 1. 因为调整为重复调用后直接报错,重构ShutdownNow()并去掉submittedTasks和Sync.RWMutex

    2. 重构Shutdown()使用sync.WaitGroup替代用time.Sleep来检测b.num==0
    3. 将StartTasks重命名为schedulingTasks
    longyue0521 committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    2f39abe View commit details
    Browse the repository at this point in the history
  4. 添加注释修改代码提高可读性

    Signed-off-by: longyue0521 <longyueli0521@gmail.com>
    longyue0521 committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    91d3741 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2022

  1. 1.task_pool.go 修改task的声明方式,显示指定其容量

    2.task_pool_test.go 重新组织测试使其更具可读性,清理魔数显示表明其意图等
    
    Signed-off-by: longyue0521 <longyueli0521@gmail.com>
    longyue0521 committed Aug 30, 2022
    Configuration menu
    Copy the full SHA
    9a195e8 View commit details
    Browse the repository at this point in the history
  2. 改为更宽泛的断言

    longyue0521 committed Aug 30, 2022
    Configuration menu
    Copy the full SHA
    8f1ce93 View commit details
    Browse the repository at this point in the history
  3. 修改测试用例

    longyue0521 committed Aug 30, 2022
    Configuration menu
    Copy the full SHA
    2f91e07 View commit details
    Browse the repository at this point in the history