File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -42,20 +42,30 @@ def incomplete?
42
42
[ :unscheduled , :pending ] . include? state
43
43
end
44
44
45
+ # @returns [Object] see Dereferenceable#deref
45
46
def value ( timeout = nil )
46
47
wait timeout
47
48
deref
48
49
end
49
50
51
+ # wait until Obligation is #complete?
52
+ # @param [Numeric] timeout the maximum time in second to wait.
53
+ # @return [Obligation] self
50
54
def wait ( timeout = nil )
51
55
event . wait ( timeout ) if timeout != 0 && incomplete?
52
56
self
53
57
end
54
58
59
+ # wait until Obligation is #complete?
60
+ # @param [Numeric] timeout the maximum time in second to wait.
61
+ # @return [Obligation] self
62
+ # @raise [Exception] when #rejected? it raises #reason
55
63
def no_error! ( timeout = nil )
56
64
wait ( timeout ) . tap { raise self if rejected? }
57
65
end
58
66
67
+ # @raise [Exception] when #rejected? it raises #reason
68
+ # @returns [Object] see Dereferenceable#deref
59
69
def value! ( timeout = nil )
60
70
wait ( timeout )
61
71
if rejected?
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ def add_observer(*args, &block)
10
10
observers . add_observer ( *args , &block )
11
11
end
12
12
13
+ # as #add_observer but it can be used for chaning
13
14
# @return [Observable] self
14
15
def with_observer ( *args , &block )
15
16
add_observer *args , &block
You can’t perform that action at this time.
0 commit comments