Permalink
Browse files

usage and basic description

  • Loading branch information...
1 parent 6febad0 commit c147580c6ab9434fafd5d4814ed5ae0863649b64 @cocoa committed Feb 16, 2013
Showing with 11 additions and 2 deletions.
  1. +11 −2 README.md
View
@@ -1,6 +1,6 @@
# Threadpool
-TODO: Write a gem description
+Based on Ruby cooking, this gem allows to run a limited pool of threads simultaneously. The gem doesn't mantain a pool of threads acepting works, it creates a new thread for every incoming work and run N of them simultaneously instead.
## Installation
@@ -18,7 +18,16 @@ Or install it yourself as:
## Usage
-TODO: Write usage instructions here
+ include Treadpool
+ tp = Tpool.new(2)
+ 1.upto(10) do |i|
+ tp.dispatch(i) do |n|
+ puts "Started #{n}..."
+ sleep(3)
+ puts "Ended #{n}..."
+ end
+ end
+ tp.shutdown
## Contributing

0 comments on commit c147580

Please sign in to comment.