Skip to content

Commit 8d4c075

Browse files
100% documentation coverage.
1 parent 3e85a2e commit 8d4c075

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/async/deadline.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
require_relative "clock"
77

8+
# @namespace
89
module 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

0 commit comments

Comments
 (0)