Skip to content

Commit d6f8251

Browse files
committed
Code formatting.
1 parent 4c0bfbc commit d6f8251

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

fixtures/async/chainable_async.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Async
99
let(:chainable) {subject.new(parent: parent)}
1010

1111
it "should chain async to parent" do
12-
expect(parent).to receive(:async).and_return {|*arguments, **options, &block|
12+
expect(parent).to receive(:async).and_return{|*arguments, **options, &block|
1313
Async(*arguments, **options, &block)
1414
}
1515

lib/async/barrier.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Barrier
1818
def initialize(parent: nil)
1919
@tasks = List.new
2020
@finished = Queue.new
21-
@cond = Condition.new
21+
@condition = Condition.new
2222

2323
@parent = parent
2424
end
@@ -51,17 +51,17 @@ def async(*arguments, parent: (@parent or Task.current), **options, &block)
5151
task = parent.async(*arguments, **options) do |task, *arguments|
5252
node = TaskNode.new(task)
5353
@tasks.append(node)
54-
54+
5555
waiting = node
56-
@cond.signal
57-
56+
@condition.signal
57+
5858
block.call(task, *arguments)
5959
ensure
6060
@finished.signal(node) unless @finished.closed?
6161
end
62-
63-
@cond.wait while waiting.nil?
64-
62+
63+
@condition.wait while waiting.nil?
64+
6565
task
6666
end
6767

test/async/barrier.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
barrier.stop
134134
end
135135
end
136-
136+
137137
it "waits even if the child task yields immediately" do
138138
class Yielder
139139
def async(*arguments, **options, &block)
@@ -143,15 +143,15 @@ def async(*arguments, **options, &block)
143143
end
144144
end
145145
end
146-
146+
147147
parent = Yielder.new
148-
148+
149149
3.times do |i|
150-
barrier.async(parent:) {i}
150+
barrier.async(parent:){i}
151151
end
152-
152+
153153
expect(barrier.size).to be == 3
154-
154+
155155
results = []
156156
barrier.wait do |task|
157157
results << task.wait

0 commit comments

Comments
 (0)