We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1cd7b86 commit cc666d0Copy full SHA for cc666d0
lib/mpv/fence.rb
@@ -45,6 +45,16 @@ def wait1(timeout: DEFAULT_TIMEOUT)
45
wait(runs: 1, timeout: timeout).first
46
end
47
48
+ def wait_until(timeout: DEFAULT_TIMEOUT, &block)
49
+ start = Concurrent.monotonic_time
50
+ loop do
51
+ x = wait1(timeout: timeout / 10)
52
+ break if block.call(x)
53
+ break if (Concurrent.monotonic_time - start) >= timeout
54
+ end
55
+ x
56
57
+
58
# Clears the calls history
59
def clear!
60
@mutex.synchronize do
0 commit comments