README.md in concurrent_worker-0.2.1 vs README.md in concurrent_worker-0.2.2
- old
+ new
@@ -20,11 +20,11 @@
## Usage
### Worker
-You can define worker block executed in other thread, and send requests to the worker.
+You can define a worker setting a work block executed in other thread, and send requests to the worker.
```ruby
require 'concurrent_worker'
Thread.abort_on_exception = true
@@ -40,15 +40,15 @@
logger.req("thread%d n=%d\n",0, 1)
logger.join
```
-If you need some preparation for the worker block, you can define 'base block'.
+If you need some preparation for the work block, you can define 'base block'.
```ruby
logger = ConcurrentWorker::Worker.new do |args|
- # worker block and base block can share object with instance variable(@xxx).
+ # work block and base block can share object with instance variable(@xxx).
printf(@file, *args)
@file.flush
nil
end
@@ -68,10 +68,10 @@
### WorkerPool
You can exec work block in some process concurrently.
```ruby
-#define a pool of 8 workers , executed in other process.
+#define a pool of 8 workers with same work block, executed in other process.
wp = ConcurrentWorker::WorkerPool.new(type: :process, pool_max: 8) do |n|
[n, n.times.inject(:+)]
end
# you can receive the result of work block with callback block.