Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungKI half beim Finden: iOS 27 schließt mehr als 100 Sicherheitslücken(21.09.2026 um 06:00 Uhr)
Sichere ProgrammierungWhat Is Rowhammer? How Can Repeated Memory Access Flip Bits in RAM?(21.09.2026 um 07:12 Uhr)
Sichere Programmierungnpm publish Ignores .gitignore: The .npmignore Override Rule(21.09.2026 um 07:15 Uhr)
Sichere ProgrammierungAphelion Editor - A free node-based video / VFX editor(21.09.2026 um 07:21 Uhr)
Sichere ProgrammierungGovernance Attack Surface Review: OKX(21.09.2026 um 07:31 Uhr)
Sichere ProgrammierungJSM Portal Request Create Property Panel Submit(21.09.2026 um 07:34 Uhr)
Reverse Engineeringsearch instructions assembly easy (X86,RISCV,AARCH64,etc)(20.09.2026 um 15:44 Uhr)
Sichere ProgrammierungKI half beim Finden: iOS 27 schließt mehr als 100 Sicherheitslücken(21.09.2026 um 06:00 Uhr)
Sichere ProgrammierungWhat Is Rowhammer? How Can Repeated Memory Access Flip Bits in RAM?(21.09.2026 um 07:12 Uhr)
Sichere Programmierungnpm publish Ignores .gitignore: The .npmignore Override Rule(21.09.2026 um 07:15 Uhr)
Sichere ProgrammierungAphelion Editor - A free node-based video / VFX editor(21.09.2026 um 07:21 Uhr)
Sichere ProgrammierungGovernance Attack Surface Review: OKX(21.09.2026 um 07:31 Uhr)
Sichere ProgrammierungJSM Portal Request Create Property Panel Submit(21.09.2026 um 07:34 Uhr)
Reverse Engineeringsearch instructions assembly easy (X86,RISCV,AARCH64,etc)(20.09.2026 um 15:44 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Go queue v1.7.0: a new Delay queue for timers, retries, and TTLs

Reagiere als Erste:r — dein Feedback zählt!

I just tagged v1.7.0 of github.com/adrianbrad/queue, a thread-safe generic queue package. The headline feature is a new Delay queue.

What is Delay?

Delay is a priority queue where each element becomes dequeuable at a deadline computed by a caller-supplied function at Offer time. Get returns ErrNoElementsAvailable until the head is due; GetWait sleeps until it is.

type task struct {
    id    int
    runAt time.Time
}

delayQueue := queue.NewDelay(
    []task{
        {id: 1, runAt: time.Now().Add(20 * time.Millisecond)},
        {id: 2, runAt: time.Now().Add(5 * time.Millisecond)},
    },
    func(t task) time.Time { return t.runAt },
)

// Blocks until the earliest-deadline element is due.
next := delayQueue.GetWait()
fmt.Println(next.id) // 2

Useful for retry scheduling, TTL expiry, timer wheels, and similar patterns where work should become visible at a future wall-clock time.

Implementation notes

  • Min-heap by deadline, written directly on a typed slice instead of via container/heap. pprof showed container/heap's any-boxing accounted for most of the allocations, so steady-state offer/get is now zero-alloc.
  • GetWait uses sync.Cond + time.AfterFunc so "head is due" and "queue state changed" compose under a single Wait.
  • Peek returns the head regardless of whether its deadline has passed (matches java.util.concurrent.DelayQueue.peek).

Five queues, one interface

Delay joins Blocking, Priority, Circular, and Linked. All satisfy the same Queue[T comparable] interface, so you can swap implementations without changing call sites. The README has a small decision table for picking one.

Bonus: v1.6.0 shipped a lot

Since the last post I also tagged v1.6.0, a heavy batch of correctness and performance work:

  • Priority.MarshalJSON was emitting elements in arbitrary heap-array order; now emits in priority order.
  • Reset on Blocking, Circular, and Priority now honours capacity and zeros dropped slots (pointer T was leaking).
  • Blocking switched from Signal to Broadcast, removing a fragile cascade in PeekWait.
  • Linked grew an internal node free list; steady-state offer/get dropped from 16 B / 1 alloc to 0.
  • Capacity validation at construction time (panics with a clear message instead of a cryptic slice panic later).

Feedback welcome

Thanks for reading.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Go queue v1.7.0: a new Delay queue for timers, retries, and TTLs

Thematisch verwandte Begriffe: queue, v170, Delay, timers · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94111 | Tencent BrowserSkill through 0.3.0 contains an authentication bypass vul…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick