This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Home
Check out
- the README for most recent info.
- Very useful Blog post launching Kestrel
- Blog post announcing Kestrel
- The Starling repo — Kestrel’s interface is similar to but more powerful than Starling’s.
- Blocking Fetch
- Reliable Fetch
-————————————————————
Basic usage
class Broker
require 'memcached'
QUEUE_SLEEP_TIME = 200
MEMCACHED_TIMEOUT = 0.250
def queue
@queue ||= Memcached.new(['localhost:22133'], :timeout => MEMCACHED_TIMEOUT)
end
def process_tasks &block
loop do
task = start_task or next
yield task
complete_task
end
end
# Retrieve a task. Returns nil on error or timeout
def start_task
begin
task = queue.get("#{task}/open/t=#{QUEUE_SLEEP_TIME}")
rescue RuntimeError => e; warn e ; return ; end
end
def complete_task
queue.get("#{task}/close") rescue nil
end
end







