Permalink
Browse files

Update Promise rescuer doc

  • Loading branch information...
pitr-ch committed Dec 3, 2017
1 parent df482db commit 967f98a3086e077bcf2f6f34cd6dc0ba629b7c9c
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/concurrent/promise.rb
View
@@ -161,15 +161,15 @@ module Concurrent
# receive the rejection `reason` as the rejection callable parameter:
#
# ```ruby
# p = [ Concurrent::Promise.execute{ Thread.pass; raise StandardError } ]
# p = Concurrent::Promise.execute { Thread.pass; raise StandardError }
#
# c1 = p.then(Proc.new{ |reason| 42 })
# c2 = p.then(Proc.new{ |reason| raise 'Boom!' })
# c1 = p.then(-> reason { 42 })
# c2 = p.then(-> reason { raise 'Boom!' })
#
# sleep(0.1)
#
# c1.state #=> :rejected
# c2.state #=> :rejected
# c1.wait.state #=> :fulfilled
# c1.value #=> 45
# c2.wait.state #=> :rejected
# c2.reason #=> #<RuntimeError: Boom!>
# ```
#
# Once a promise is rejected it will continue to accept children that will

0 comments on commit 967f98a

Please sign in to comment.