All Projects → hakanensari → turnpike

hakanensari / turnpike

Licence: MIT license
A Redis-backed FIFO queue

Programming Languages

ruby
36898 projects - #4 most used programming language

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].