GO-QUEUE@v1.1.1: 基于優先級的並發排程,自動提升優先權

Published: (January 1, 2026 at 01:18 AM EST)
1 min read
Source: Dev.to

Source: Dev.to

cover

REFACTOR

  • PresetConfig.Prioritystring 改為 Priority 型別,移除字串解析邏輯
  • WithRetry 參數從 *int 改為變長參數 ...int,支援無參數調用

UPDATE

  • 改進 timeout 計算邏輯,直接使用 time.Duration 運算
  • 更新優先級升級邏輯,使用新的優先級常數替代字串

PERF

  • 新增 taskHeap cap 縮減機制,當使用量低於容量 1/4 時自動縮減至一半(最小保留 16)

REMOVE

  • 移除 getPresetPriority 函式
  • Pop() 中設置 old[n-1] = nil 避免記憶體洩漏
Back to Blog

Related posts

Read more »

An Honest Review of Go (2025)

Article URL: https://benraz.dev/blog/golang_review.html Comments URL: https://news.ycombinator.com/item?id=46542253 Points: 58 Comments: 50...