Skip to content

AnalyzePlatypus/filequeue

 
 

Repository files navigation

FileQueue Build Status

A simple file based queue written in Ruby that uses the battle-tested Filelock gem to push and pop items into a queue. It's not web scale but is nice for lightweight async queuing apps.

Install

gem install filequeue

Usage

queue = FileQueue.new 'queue_party.txt'

queue.push "an item"
# => true

queue.pop
# => "an item"

See spec/filequeue_spec.rb for more usage details

Docs

FileQueue has the following class methods:

  • push (alias <<)
  • pop
  • length
  • empty?
  • clear

Dependencies

Locking is delegated to the excellent Filelock gem. All of the Filelock's caveats apply.

Limitations

Authorship