Skip to content

Commit 79de972

Browse files
committed
Replaced remaining references to global task and operation thread pools.
1 parent 1238a28 commit 79de972

File tree

6 files changed

+5
-45
lines changed

6 files changed

+5
-45
lines changed

lib/concurrent/actor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def self.root
6060
# Actor.spawn name: :ping3,
6161
# class: AdHoc,
6262
# args: [1]
63-
# executor: Concurrent.configuration.global_task_pool do |add|
63+
# executor: Concurrent.global_io_executor do |add|
6464
# lambda { |number| number + add }
6565
# end
6666
#

lib/concurrent/async.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def init_mutex
198198
serializer = Concurrent::SerializedExecution.new
199199

200200
@__async_executor__ = Delay.new(executor: :immediate) {
201-
Concurrent.configuration.global_task_pool
201+
Concurrent.global_io_executor
202202
}
203203

204204
@__await_delegator__ = Delay.new(executor: :immediate) {

lib/concurrent/dataflow.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def update(time, value, reason)
3232
# @raise [ArgumentError] if no block is given
3333
# @raise [ArgumentError] if any of the inputs are not `IVar`s
3434
def dataflow(*inputs, &block)
35-
dataflow_with(Concurrent.configuration.global_operation_pool, *inputs, &block)
35+
dataflow_with(Concurrent.global_io_executor, *inputs, &block)
3636
end
3737
module_function :dataflow
3838

@@ -42,7 +42,7 @@ def dataflow_with(executor, *inputs, &block)
4242
module_function :dataflow_with
4343

4444
def dataflow!(*inputs, &block)
45-
dataflow_with!(Concurrent.configuration.global_task_pool, *inputs, &block)
45+
dataflow_with!(Concurrent.global_io_executor, *inputs, &block)
4646
end
4747
module_function :dataflow!
4848

spec/concurrent/agent_spec.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,22 +98,6 @@ def trigger_observable(observable)
9898
agent.post { |value| 0 }
9999
end
100100

101-
it 'uses the global io executor when :executor is :task' do
102-
warn 'deprecated syntax'
103-
expect(Concurrent).to \
104-
receive(:global_io_executor).at_least(:once).and_return(executor)
105-
agent = Agent.new(0, executor: :task)
106-
agent.post { |value| 0 }
107-
end
108-
109-
it 'uses the global fast executor when :executor is :operation' do
110-
warn 'deprecated syntax'
111-
expect(Concurrent).to \
112-
receive(:global_fast_executor).at_least(:once).and_return(executor)
113-
agent = Agent.new(0, executor: :operation)
114-
agent.post { |value| 0 }
115-
end
116-
117101
it 'uses the global io executor for #post by default' do
118102
expect(Concurrent).to \
119103
receive(:global_io_executor).at_least(:once).and_return(executor)

spec/concurrent/dataflow_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Concurrent
1313
specify '#dataflow uses the global fast executor' do
1414
input = Future.execute{0}
1515
expect(Concurrent).to receive(:dataflow_with).once.
16-
with(Concurrent.global_fast_executor, input)
16+
with(Concurrent.global_io_executor, input)
1717
Concurrent::dataflow(input){0}
1818
end
1919

spec/concurrent/future_spec.rb

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -116,30 +116,6 @@ def trigger_observable(observable)
116116
Future.execute(executor: executor){ nil }
117117
end
118118

119-
it 'uses the global fast executor when :operation is true' do
120-
warn 'deprecated syntax'
121-
expect(Concurrent).to receive(:global_fast_executor).and_return(executor)
122-
Future.execute(operation: true){ nil }
123-
end
124-
125-
it 'uses the global io executor when :task is true' do
126-
warn 'deprecated syntax'
127-
expect(Concurrent).to receive(:global_io_executor).and_return(executor)
128-
Future.execute(task: true){ nil }
129-
end
130-
131-
it 'uses the global fast executor when :operation is true' do
132-
warn 'deprecated syntax'
133-
expect(Concurrent).to receive(:global_fast_executor).and_return(executor)
134-
Future.execute(operation: true){ nil }
135-
end
136-
137-
it 'uses the global io executor when :task is true' do
138-
warn 'deprecated syntax'
139-
expect(Concurrent).to receive(:global_io_executor).and_return(executor)
140-
Future.execute(task: true){ nil }
141-
end
142-
143119
it 'uses the global io executor by default' do
144120
expect(Concurrent).to receive(:global_io_executor).and_return(executor)
145121
Future.execute{ nil }

0 commit comments

Comments
 (0)