v1.1.3 Release Notes
Released
REFACTOR
- Replace
Queue.closedbool +sync.RWMutexwithatomic.Uint32state - Use CAS in
Start()to ensure transition fromstateCreatedtostateRunningonly - Use CAS loop in
Shutdown()for idempotent closure (allow multiple calls)
UPDATE
- Change
Start()return type toerrorfor state check error reporting - Change
Config.Timeouttype fromint64totime.Duration - Change default
Timeoutfrom30to30 * time.Second
FIX
- Fix
Enqueue()error message formatting, use%wto wrap underlying error - Fix
Shutdown()to callcancel()after completion for context cleanup
REFACTOR
- 將
Queue.closedbool +sync.RWMutex替換為atomic.Uint32state - 在
Start()中使用 CAS 確保只能從stateCreated轉換到stateRunning - 在
Shutdown()中使用 CAS loop 確保冪等性關閉(允許多次調用)
UPDATE
- 修改
Start()返回型別為error,支援狀態檢查錯誤回報 Config.Timeout型別從int64改為time.Duration- 預設
Timeout值從30改為30 * time.Second
FIX
- 修正
Enqueue()錯誤訊息格式化,使用%w包裹底層錯誤 - 修正
Shutdown()在完成後呼叫cancel()清理 context