Tarantool CE/EE Documentation portal logo
Support
Updated at July 17, 2026   02:08 PM

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