LifeCycle

class LifecycleService(config, logger_extras=None)

Bases: object

LifecycleService allows you to shutdown, terminate, and listen to LifecycleEvent’s on HazelcastInstances.

logger = <logging.Logger object>
state = None
add_listener(on_lifecycle_change)

Add a listener object to listen for lifecycle events.

Parameters:on_lifecycle_change – (Function), function to be called when LifeCycle state is changed.
Returns:(str), id of the listener.
remove_listener(registration_id)

Removes a lifecycle listener.

Parameters:registration_id – (str), the id of the listener to be removed.
Returns:(bool), true if the listener is removed successfully, false otherwise.
fire_lifecycle_event(new_state)

Called when instance’s state changes.

Parameters:new_state – (Lifecycle State), the new state of the instance.