kaskada.api.local_session.local_session_keep_alive
Module Contents
Classes
An implementation of a thread to poll the Local Session for the overall status and recover from failure by restarting the services. |
Attributes
- class LocalSessionKeepAlive(manager_service, engine_service, client, interval_seconds=1, maximum_unready_polls=3, should_check=True)[source]
Bases:
threading.Thread
An implementation of a thread to poll the Local Session for the overall status and recover from failure by restarting the services. This implementation is thread-safe.
- Parameters:
manager_service (kaskada.api.local_session.local_service.KaskadaLocalService) –
engine_service (kaskada.api.local_session.local_service.KaskadaLocalService) –
client (kaskada.client.Client) –
interval_seconds (int) –
maximum_unready_polls (int) –
should_check (bool) –
- run()[source]
Runs indefinitely and monitors the status of the manager service, the engine service, and the connected client. If any of them report unready, then all of the services are restarted and the client reconnects.
To stop the keep alive, use the stop() method to trigger the thread to conclude.