Method Postgres.postgres()->_set_notify_callback()


Method _set_notify_callback

void _set_notify_callback()
void _set_notify_callback(function(:void) f)

Description

With Postgres you can associate events and notifications to tables. This function allows you to detect and handle such events.

With no arguments, resets and removes any callback you might have put previously, and any polling cycle.

With one argument, sets the notification callback (there can be only one for each sqlobject).

The callback function must return no value, and takes a string argument, which will be the name of the table on which the notification event has occurred. In future versions, support for user-specified arguments will be added.

Note

The Sql.postgres program adds support for automatic delivery of messages (see it for explanation on the inner workings of this feature).

This function is Postgres-specific, and thus it is not available through the generic SQL-interface

See also

Sql.postgres