Skip to content

Instantly share code, notes, and snippets.

@ColinDKelley
Created March 13, 2014 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ColinDKelley/9519345 to your computer and use it in GitHub Desktop.
Save ColinDKelley/9519345 to your computer and use it in GitHub Desktop.
limited_work_queue-example.rb
queue = LimitedWorkQueue(EventMachine, 2)
messages.each do |message|
queue.add do
message.send # no more than 2 of these will run at the same time
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment