Project

turnpike

0.01
Low commit activity in last 3 years
No release in over a year
A Redis-backed FIFO queue
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.0
>= 0

Runtime

~> 1.0
 Project Readme

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.