Skip to content

Commit 1447a38

Browse files
committed
Updated Actor to use the global io executor.
1 parent 390ac66 commit 1447a38

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/concurrent/actor/core.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Core
3535
# @option opts [Class] reference a custom descendant of {Reference} to use
3636
# @option opts [Context] actor_class a class to be instantiated defining Actor's behaviour
3737
# @option opts [Array<Object>] args arguments for actor_class instantiation
38-
# @option opts [Executor] executor, default is `Concurrent.configuration.global_task_pool`
38+
# @option opts [Executor] executor, default is `Concurrent.global_io_executor`
3939
# @option opts [true, false] link, atomically link the actor to its parent
4040
# @option opts [true, false] supervise, atomically supervise the actor by its parent
4141
# @option opts [Array<Array(Behavior::Abstract, Array<Object>)>]
@@ -56,7 +56,7 @@ def initialize(opts = {}, &block)
5656
@context_class = Child! opts.fetch(:class), AbstractContext
5757
allocate_context
5858

59-
@executor = Type! opts.fetch(:executor, Concurrent.configuration.global_task_pool), Executor
59+
@executor = Type! opts.fetch(:executor, Concurrent.global_io_executor), Executor
6060
raise ArgumentError, 'ImmediateExecutor is not supported' if @executor.is_a? ImmediateExecutor
6161

6262
@reference = (Child! opts[:reference_class] || @context.default_reference_class, Reference).new self

lib/concurrent/actor/reference.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ def tell(message)
2727

2828
# @note it's a good practice to use tell whenever possible. Ask should be used only for
2929
# testing and when it returns very shortly. It can lead to deadlock if all threads in
30-
# global_task_pool will block on while asking. It's fine to use it form outside of actors and
31-
# global_task_pool.
30+
# global_io_executor will block on while asking. It's fine to use it form outside of actors and
31+
# global_io_executor.
3232
#
3333
# sends message to the actor and asks for the result of its processing, returns immediately
3434
# @param [Object] message
@@ -40,8 +40,8 @@ def ask(message, ivar = IVar.new)
4040

4141
# @note it's a good practice to use tell whenever possible. Ask should be used only for
4242
# testing and when it returns very shortly. It can lead to deadlock if all threads in
43-
# global_task_pool will block on while asking. It's fine to use it form outside of actors and
44-
# global_task_pool.
43+
# global_io_executor will block on while asking. It's fine to use it form outside of actors and
44+
# global_io_executor.
4545
#
4646
# sends message to the actor and asks for the result of its processing, blocks
4747
# @param [Object] message

0 commit comments

Comments
 (0)