Skip to content

Releases: simplegear/rate-envelope-queue

v1.2.0 - Actual stop mechanism and logs

27 Oct 09:41
cc98aa7

Choose a tag to compare

Merge pull request #46 from simplegear/v1

V1

v1.2.0-rc.4 - Added Drain() and fixed Terminate()

22 Oct 05:59
d1be3f9

Choose a tag to compare

Merge pull request #48 from simplegear/pre-release-v1

Pre release v1

v1.2.0-rc.2

17 Oct 09:11
b0b35fe

Choose a tag to compare

v1.2.0-rc.2 Pre-release
Pre-release
Merge pull request #43 from simplegear/pre-release-v1

Pre release v1

v1.1.1 - Moving to github.com/simplegear/rate-envelope-queue/releases/new

29 Sep 06:26
ee9bb00

Choose a tag to compare

v1.1.0 - Stability and internal features

16 Sep 08:01
4caae08

Choose a tag to compare

Release Notes [v1.1.0]

Added

  • Terminate() — method to gracefully finalize the last node in the queue state.
  • CurrentState() — method to retrieve the current state of the internal state machine.
  • Additional integration tests for examples and runtime validation.

Changed

  • Improved test coverage to enhance overall stability.

Fixed

  • Minor internal adjustments in the queue state logic to improve predictability.

v1.0.0 - rate-envelope-queue

05 Sep 04:28
75194fd

Choose a tag to compare

rate-envelope-queue v1.0.0

✨ Highlights

  • Safe lifecycle: Start() / Stop() / Start() again without tearing down your app.
  • Worker pool: Fixed number of goroutines (WithLimitOption(n)).
  • One-shot & periodic tasks: interval == 0 (once) or interval > 0 (rescheduled with AddAfter).
  • Deadlines: Per-task timeout via context.WithTimeout; deadline == 0 = no deadline.
  • Hooks: beforeHook, afterHook, failureHook, successHook with bounded execution time.
  • Stamps (middleware): Chainable wrappers around your invoke (both queue-wide and per-task).
  • Capacity control: Optional in-memory quota (WithAllowedCapacityOption(cap)), including unlimited when cap == 0.
  • Graceful vs fast stop: Drain (read out everything) and Stop (fast shutdown) modes, plus a waiting switch to join workers.
  • Panic safety: Panics inside tasks are caught; item is Forget + Done; worker keeps running.
  • Observability: Prometheus workqueue_* metrics via blank-import of the k8s registry.

📈 Benchmarks (as reported by the author; HW/OS affect numbers)

  • Dynamic tasks: ~328–349 ns/op, ~37–40 B/op, 1 alloc/op
  • Scheduled tasks: ~12.9 µs/op, ~1809 B/op, 24 alloc/op
BenchmarkQueueFull:     3.2M   348.7 ns/op    40 B/op    1 alloc/op
BenchmarkQueueInterval: 110K   12.9 µs/op     1809 B/op  24 alloc/op

🧠 Semantics (short)

  • Deduplication: by pointer identity of the enqueued item (inherited from workqueue).
  • “Alive” check for rescheduling periodic tasks: queue is running + base ctx alive + not shutting down.
  • Special error: ErrStopEnvelope → item is forgotten and not rescheduled.
    If it was returned by beforeHook/invoke, the afterHook is still called (with bounded time).
    successHook is not called on ErrStopEnvelope.
  • Timeouts: context.Canceled / DeadlineExceeded are treated as non-success; periodic tasks are rescheduled, one-shot tasks are not.
  • Errors:
    • Periodic → reschedule if queue is alive.
    • One-shot → routed to failureHook → RetryNow / RetryAfter(d) / Drop.
  • Hook time limits: per-hook budget = min(hardHookLimit, frac * deadline) (never outlives the task deadline).

v0.0.4 - Rebuilding of package

24 Aug 10:39
fb70608

Choose a tag to compare

Rebuilding of package

v0.0.3 - Incapsulation for envelope

24 Aug 07:31
ac0a4e5

Choose a tag to compare

With option functions for envelope constructor.

v0.0.2 - Envelopes and stamps

23 Aug 17:57

Choose a tag to compare

Envelops and stamps

v0.0.1 - Dynamic and static semaphores

23 Aug 14:10

Choose a tag to compare

Simple simultaneous fast queue with high speed. Dynamic and static semaphores. Serialized keys for the envelope. A simple and accurate lifecycle.