v1.2.1

v0.4.0 Release Notes

Released


Fretures


Task Dependencies

  • Added support for dependent tasks, executed after other tasks are completed.
  • Added multiple dependencies, allowing a task to depend on multiple preceding tasks.

Dependency Execution

  • Introduced a worker pool to limit concurrent executions and reduce high-concurrency errors.

Function Extensions

  • Added support for func() error for error handling in dependent tasks (mandatory for dependent tasks).
  • Retained func() for tasks without dependencies.

Execution Routing

  • Tasks without dependencies execute directly, while tasks with dependencies are managed via the worker pool.

Refactor


Concurrency Safety

  • Added task.mutex to protect concurrent read/write of task states.
  • Added dependManager.mutex to safeguard concurrent operations in the dependency manager.

Resource Management

  • Implemented lifecycle management for the worker pool.



新增


任務依賴

  • 新增依賴任務支援,於其他任務完成後執行
  • 新增多重依賴,一可依賴多個前置任務

依賴執行

  • 新增 Worker 池,限制併發執行數量,減少高併發錯誤

函式擴展

  • 新增 func() error 支援,用於依賴任務的錯誤處理(依賴任務必要)
  • 保有 func(),用於無依賴任務

執行路由

  • 無依賴任務直接執行,有依賴任務透過 worker 池管理

重構


併發安全

  • 新增 task.mutex 保護任務狀態的併發讀寫
  • 新增 dependManager.mutex 保護依賴管理器的併發操作

資源管理

  • 新增 Worker 池的生命週期管理