Created
March 13, 2014 00:07
-
-
Save ColinDKelley/9519345 to your computer and use it in GitHub Desktop.
limited_work_queue-example.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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