File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,13 @@ module Concurrent
66 # An executor service which runs all operations on the current thread,
77 # blocking as necessary. Operations are performed in the order they are
88 # received and no two operations can be performed simultaneously.
9+ #
10+ # This executor service exists mainly for testing an debugging. When used
11+ # it immediately runs every `#post` operation on the current thread, blocking
12+ # that thread until the operation is complete. This can be very beneficial
13+ # during testing because it makes all operations deterministic.
14+ #
15+ # @note Intended for use primarily in testing and debugging.
916 class ImmediateExecutor
1017 include SerialExecutor
1118
Original file line number Diff line number Diff line change @@ -5,8 +5,18 @@ module Concurrent
55
66 # An executor service in which every operation spawns a new,
77 # independently operating thread.
8+ #
9+ # This is perhaps the most inefficient executor service in this
10+ # library. It exists mainly for testing an debugging. Thread creation
11+ # and management is expensive in Ruby and this executor performs no
12+ # resource pooling. This can be very beneficial during testing and
13+ # debugging because it decouples the using code from the underlying
14+ # executor implementation. In production this executor will likely
15+ # lead to suboptimal performance.
16+ #
17+ # @note Intended for use primarily in testing and debugging.
818 class PerThreadExecutor
9- include SerialExecutor
19+ include Executor
1020
1121 # Creates a new executor
1222 def initialize
You can’t perform that action at this time.
0 commit comments