Definitions of built-in functions that allow the scripting layer to change the value of options and to be notified when option values change.
Set an option to a new value.
Set a change handler for an option.
Set an option to a new value. This change will also cause the option change handlers to be called.
The ID of the option to update.
The new value of the option.
Optional parameter detailing where this change originated from.
true on success, false when an error occurred.
Option::setonly works on one node and does not distribute new values across a cluster. The higher-level
Config::set_valuesupports clusterization and should typically be used instead of this lower-level function.
Set a change handler for an option. The change handler will be called anytime
Option::setis called for the option.
The ID of the option for which change notifications are desired.
The function that will be called when a change occurs. The function can choose to receive two or three parameters: the first parameter is a string containing ID, the second parameter is the new option value. The third, optional, parameter is the location string as passed to Option::set. Note that the global value is not yet changed when the function is called. The passed function has to return the new value that it wants the option to be set to. This enables it to reject changes, or change values that are being set. When several change handlers are set for an option they are chained; the second change handler will see the return value of the first change handler as the “new value”.
The priority of the function that was added; functions with higher priority are called first, functions with the same priority are called in the order in which they were added.
true when the change handler was set, false when an error occurred.