Class: Karafka::Instrumentation::Vendors::Kubernetes::SwarmLivenessListener
- Inherits:
-
BaseListener
- Object
- BaseListener
- Karafka::Instrumentation::Vendors::Kubernetes::SwarmLivenessListener
- Defined in:
- lib/karafka/instrumentation/vendors/kubernetes/swarm_liveness_listener.rb
Overview
Kubernetes HTTP listener designed to operate with Karafka running in the swarm mode In the Swarm mode we supervise only the supervisor as other nodes are suppose to be managed by the swarm supervisor
Instance Method Summary collapse
-
#initialize(hostname: nil, port: 3000, controlling_ttl: 60 * 1_000) ⇒ SwarmLivenessListener
constructor
A new instance of SwarmLivenessListener.
-
#on_app_supervising(_event) ⇒ Object
Starts reporting in the supervisor only when it runs.
-
#on_swarm_manager_control(_event) ⇒ Object
Tick on each control.
Constructor Details
#initialize(hostname: nil, port: 3000, controlling_ttl: 60 * 1_000) ⇒ SwarmLivenessListener
Returns a new instance of SwarmLivenessListener.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/karafka/instrumentation/vendors/kubernetes/swarm_liveness_listener.rb', line 19 def initialize( hostname: nil, port: 3000, controlling_ttl: 60 * 1_000 ) @hostname = hostname @port = port @controlling_ttl = controlling_ttl @controlling = monotonic_now super(port: port, hostname: hostname) end |
Instance Method Details
#on_app_supervising(_event) ⇒ Object
Starts reporting in the supervisor only when it runs
33 34 35 |
# File 'lib/karafka/instrumentation/vendors/kubernetes/swarm_liveness_listener.rb', line 33 def on_app_supervising(_event) start end |
#on_swarm_manager_control(_event) ⇒ Object
Tick on each control
39 40 41 |
# File 'lib/karafka/instrumentation/vendors/kubernetes/swarm_liveness_listener.rb', line 39 def on_swarm_manager_control(_event) @controlling = monotonic_now end |