Enable Leader Election ¶

This guide will show you how to enable leader election for your application.

Enable leader election in manifest ¶

.nais/app.yaml

yaml

Using leader election in your application (simple API) ¶

java
bash
python
typescript

Using leader election in your application (Server Sent Events API) ¶

👷 Help Wanted! Please contribute with examples on how to use the Server Sent Events API.

WebFlux to create a subscription, and an ApplicationEvent to inform about changes.

kotlin

Using sseclient to subscribe to the leader election events, and passing them to a handler function. Probably needs to be run in a separate thread.

python