Ejemplo n.º 1
0
 def on_join(session: Session, session_details: SessionDetails):
     component.session = session
     component.session_details = session_details
     session.subscribe(component.on_heartbeat_rate,
                       TOPIC_HEARTBEAT_RATE,
                       options=SubscribeOptions(get_retained=True))
     session.register(component.rpc_healthcheck,
                      f'py.ms.{component.name}.healthcheck')
     session.register(component.on_restart,
                      f'py.ms.{component.name}.restart')
     session.register(component.on_stop, f'py.ms.{component.name}.stop')
Ejemplo n.º 2
0
 def on_join(session: Session, session_details: SessionDetails):
     component.session = session
     component.session_details = session_details
     session.subscribe(component.on_heartbeat, TOPIC_HEARTBEAT)
     component.publish_heartbeat_rate(HEARTBEAT_RATE)
     component.dead_service_check_loop.start(HEARTBEAT_RATE)