File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 55
66require_relative "clock"
77
8+ # @namespace
89module Async
910 # Manages a countdown timer for timeout operations.
1011 # Provides precise deadline tracking for compound operations to prevent timeout accumulation where multiple operations could exceed user timeouts.
@@ -13,10 +14,14 @@ class Deadline
1314 # Singleton module for immediate timeouts (zero or negative).
1415 # Avoids object allocation for performance.
1516 module Zero
17+ # Check if the deadline has expired.
18+ # @returns [Boolean] Always returns true since zero timeouts are immediately expired.
1619 def self . expired?
1720 true
1821 end
1922
23+ # Get the remaining time.
24+ # @returns [Integer] Always returns 0 since zero timeouts have no remaining time.
2025 def self . remaining
2126 0
2227 end
@@ -62,4 +67,4 @@ def expired?
6267 self . remaining <= 0
6368 end
6469 end
65- end
70+ end
You can’t perform that action at this time.
0 commit comments