Next: Configuration errors, Previous: Configuration parameters, Up: Configuration functions [Contents][Index]

#### 2.5.3 Configuration events

When the value of a configuration parameter is altered, either directly or by loading a configuration file, a configuration event is generated. Handlers can be registered to be notified when a configuration event occurs. A configuration event is associated with the group and key that had its value modified.

If a configuration event is emitted by a configuration context, it propagates to all configuration contexts which inherit that group and key from it.

A configuration event handler must be a closure that accepts three arguments:

    handler cfg group key

cfg is always the configuration context that received the event, and the group and key identify the configuration parameter that changed. When a configuration group is deleted, group argument is set to the name of the deleted group and key argument is set to an empty string.

Function: add-config-event! cfg handler

  Registers handler to be called when configuration changes in the context cfg.

  Since 1.10.

Function: remove-config-event! cfg handler

  Stops handler from being called when configuration changes in the context cfg.

  Since 1.10.