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.
gem install filequeue
queue = FileQueue.new 'queue_party.txt'
queue.push "an item"
# => true
queue.pop
# => "an item"
See spec/filequeue_spec.rb
for more usage details
FileQueue
has the following class methods:
push
(alias<<
)pop
length
empty?
clear
Locking is delegated to the excellent Filelock
gem.
All of the Filelock
's caveats apply.
- NFS is not supported