feat: add bounded task priority and fair application dispatch

This commit is contained in:
2026-09-17 18:45:54 +08:00
parent 958b4a8cea
commit 309ed75666
42 changed files with 1277 additions and 61 deletions

View File

@@ -309,11 +309,12 @@ func TestIntegrationKeyedConcurrency(t *testing.T) {
sf := newScheduleFixture(t, f)
def := sf.definition()
def.Task.ConcurrencyKey = "schedule/resource"
def.Task.Priority = 7
v := sf.create(def)
sf.due(v, 2*time.Second)
sf.tick()
a, ref := f.claim()
if a.Task.ConcurrencyKey != def.Task.ConcurrencyKey || a.ConcurrencyToken == 0 {
if a.Task.ConcurrencyKey != def.Task.ConcurrencyKey || a.ConcurrencyToken == 0 || a.Task.Priority != 7 {
t.Fatal("schedule omitted frozen key")
}
noKeyClaim(t, f)