@@ -10,7 +10,7 @@ module Concurrent
10
10
# intervals. The thread that performs the task sleeps for the given interval then
11
11
# wakes up and performs the task. Lather, rinse, repeat... This pattern causes two
12
12
# problems. First, it is difficult to test the business logic of the task because the
13
- # task itself is tightly coupled with the concurrency logic. Second, an exception in
13
+ # task itself is tightly coupled with the concurrency logic. Second, an exception
14
14
# raised while performing the task can cause the entire thread to abend. In a
15
15
# long-running application where the task thread is intended to run for days/weeks/years
16
16
# a crashed task thread can pose a significant problem. `TimerTask` alleviates both problems.
@@ -23,13 +23,13 @@ module Concurrent
23
23
# performing logging or ancillary operations. `TimerTask` can also be configured with a
24
24
# timeout value allowing it to kill a task that runs too long.
25
25
#
26
- # One other advantage of `TimerTask` is it forces the business logic to be completely decoupled
26
+ # One other advantage of `TimerTask` is that it forces the business logic to be completely decoupled
27
27
# from the concurrency logic. The business logic can be tested separately then passed to the
28
28
# `TimerTask` for scheduling and running.
29
29
#
30
30
# In some cases it may be necessary for a `TimerTask` to affect its own execution cycle.
31
- # To facilitate this a reference to the task object is passed into the block as a block
32
- # argument every time the task is executed.
31
+ # To facilitate this, a reference to the TimerTask instance is passed as an argument
32
+ # to the provided block every time the task is executed.
33
33
#
34
34
# The `TimerTask` class includes the `Dereferenceable` mixin module so the result of
35
35
# the last execution is always available via the `#value` method. Derefencing options
@@ -39,7 +39,7 @@ module Concurrent
39
39
# `TimerTask` supports notification through the Ruby standard library
40
40
# {http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html Observable}
41
41
# module. On execution the `TimerTask` will notify the observers
42
- # with threes arguments: time of execution, the result of the block (or nil on failure),
42
+ # with three arguments: time of execution, the result of the block (or nil on failure),
43
43
# and any raised exceptions (or nil on success). If the timeout interval is exceeded
44
44
# the observer will receive a `Concurrent::TimeoutError` object as the third argument.
45
45
#
0 commit comments