shutdown_query property

This is a SQL statement that is executed right after begin_poll. The result should contain only the value yes (or 1) or no (or 0). To shut down the Notifier, specify yes or 1. This statement is executed as a standalone transaction.

If you are storing the shutdown state in a table, then you can use the end_connection property to reset the state before the Notifier disconnects.