Created
July 25, 2008 21:19
-
-
Save peteonrails/2526 to your computer and use it in GitHub Desktop.
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
require "threaded_collections" | |
threadcount = 2 | |
arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] | |
tps = ThreadedCollectionProcessor.new(arr) | |
tps.process(2) { |thread_id, item| puts "Thread #{thread_id} processed item: #{item}" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment