Belay.Queues (Belay v1.0.0-rc.6)

Copy Markdown View Source

Runtime queue management, persisted in the database and applied by every node — no leader, no deploy.

Belay.Queues.put(MyApp.Belay, :imports,
  limit: 10, global_limit: 4, rate: [allowed: 100, period: 60])

Belay.Queues.delete(MyApp.Belay, :imports)
Belay.Queues.list(MyApp.Belay)

Each node's queue-sync process reconciles its local producers against the table every dynamic_sync interval (default 5s): new entries start producers, deletions stop them, changed options restart them. A dynamic entry with the same name as a static queue overrides it. Options are validated on put/3, so a bad entry never reaches producers.

Summary

Functions

Delete a dynamic queue. Its node-local producers stop on the next sync.

List dynamic queues as {name, opts} pairs.

Create or update a dynamic queue. Options as in the static config.

Functions

delete(name, queue)

Delete a dynamic queue. Its node-local producers stop on the next sync.

list(name)

List dynamic queues as {name, opts} pairs.

put(name, queue, opts)

Create or update a dynamic queue. Options as in the static config.