A Redis-backed FIFO queue
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore spike Jul 15, 2011
.travis.yml
Gemfile
LICENSE
README.md
Rakefile
turnpike.gemspec Add MiniTest as explicit dependency Dec 28, 2016

README.md

Turnpike

turnpike

Turnpike is a minimal Redis-backed FIFO queue in Ruby.

Usage

Push and pop:

q = Turnpike.call('queue name')
q.push('foo', 'bar', 'baz', 'qux') # => 4
q.pop # => 'foo'

Pop multiple items:

q.pop(2) # => ['bar', 'baz']

Push payload to the front of the queue:

q.unshift('foo') # => 2
q.pop # => 'foo'

Use a queue with set-like properties to ensure uniqueness of queued items:

q = Turnpike.call('queue name', unique: true)
q.push('foo', 'bar') # => 2
q.push('bar') # => 2
q.pop(3) # => ['foo', 'bar']

Turnpike requires Ruby 2.0 and Redis 2.6 or higher.