Kanban provides tools to model task flow in distributed apps.
require 'redis'
require 'kanban'
backlog = Kanban::Backlog.new backend: Redis.new
task = { 'foo' => 'bar' }
5.times { backlog.add task }
task_id = backlog.claim # Will block until there is a task, if the backlog is empty or all tasks are being worked.
details = backlog.get task_id
backlog.complete task_id
# or backlog.unworkable task_id
backlog.done? task_id # => true
- Claims expire after awhile (default 3 seconds), and become eligible to
be worked by something else.
kanban
is available under the MIT License. See LICENSE.txt
for the full text.