Skip to content

Commit 96fd9c2

Browse files
committed
Minor doc update
1 parent d58679c commit 96fd9c2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/edge_futures.in.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
### Error handling
3333

3434
Concurrent.future { Object.new }.then(&:succ).then(&:succ).rescue { |e| e.class }.value # error propagates
35-
Concurrent.future { Object.new }.then(&:succ).rescue { 1 }.then(&:succ).value
36-
Concurrent.future { 1 }.then(&:succ).rescue { |e| e.message }.then(&:succ).value
35+
Concurrent.future { Object.new }.then(&:succ).rescue { 1 }.then(&:succ).value # rescued and replaced with 1
36+
Concurrent.future { 1 }.then(&:succ).rescue { |e| e.message }.then(&:succ).value # no error, rescue not applied
3737

3838
failing_zip = Concurrent.succeeded_future(1) & Concurrent.failed_future(StandardError.new('boom'))
3939
failing_zip.result

examples/edge_futures.out.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636

3737
Concurrent.future { Object.new }.then(&:succ).then(&:succ).rescue { |e| e.class }.value # error propagates
3838
# => NoMethodError
39-
Concurrent.future { Object.new }.then(&:succ).rescue { 1 }.then(&:succ).value
39+
Concurrent.future { Object.new }.then(&:succ).rescue { 1 }.then(&:succ).value # rescued and replaced with 1
4040
# => 2
41-
Concurrent.future { 1 }.then(&:succ).rescue { |e| e.message }.then(&:succ).value
41+
Concurrent.future { 1 }.then(&:succ).rescue { |e| e.message }.then(&:succ).value # no error, rescue not applied
4242
# => 3
4343

4444
failing_zip = Concurrent.succeeded_future(1) & Concurrent.failed_future(StandardError.new('boom'))
45-
# => <#Concurrent::Edge::Future:0x7fcc731c00b0 failed blocks:[]>
45+
# => <#Concurrent::Edge::Future:0x7ffcc19ac2a0 failed blocks:[]>
4646
failing_zip.result # => [false, [1, nil], [nil, #<StandardError: boom>]]
4747
failing_zip.then { |v| 'never happens' }.result # => [false, [1, nil], [nil, #<StandardError: boom>]]
4848
failing_zip.rescue { |a, b| (a || b).message }.value

0 commit comments

Comments
 (0)