Skip to content

Commit 8635ef3

Browse files
100% documentation coverage.
1 parent 77ab96e commit 8635ef3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/async/service/supervisor/monitor.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@
88
module Async
99
module Service
1010
module Supervisor
11+
# Base class for supervisor monitors that run periodically within the supervisor process.
12+
#
13+
# Subclasses should override {#run_once} to implement specific monitoring logic.
1114
class Monitor
15+
# Initialize a new monitor.
16+
#
17+
# @parameter interval [Numeric] The interval in seconds between each invocation of {#run_once}.
1218
def initialize(interval: 1.0)
1319
@interval = interval
1420
end
1521

22+
# Serialize the monitor state for JSON representation.
23+
#
24+
# @returns [Hash] An empty hash by default; subclasses should override to include relevant state.
1625
def as_json(...)
1726
{}
1827
end

0 commit comments

Comments
 (0)