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 77ab96e commit 8635ef3Copy full SHA for 8635ef3
lib/async/service/supervisor/monitor.rb
@@ -8,11 +8,20 @@
8
module Async
9
module Service
10
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.
14
class Monitor
15
+ # Initialize a new monitor.
16
17
+ # @parameter interval [Numeric] The interval in seconds between each invocation of {#run_once}.
18
def initialize(interval: 1.0)
19
@interval = interval
20
end
21
22
+ # Serialize the monitor state for JSON representation.
23
24
+ # @returns [Hash] An empty hash by default; subclasses should override to include relevant state.
25
def as_json(...)
26
{}
27
0 commit comments