Tarantool CE/EE Documentation portal logo
Support
Updated at October 21, 2026   10:46 AM

box.ctl.on_election()

on_election(trigger-function)

Since: 2.10.0

Create a trigger executed every time the current state of a replica set node in regard to leader election changes. The current state is available in the box.info.election table.

The trigger doesn't accept any parameters. You can see the changes in box.info.election and box.info.synchro.

Parameters:

  • trigger-function (function) — a trigger function

Returns

nil or a function pointer