go/zodb: Require drivers to provide notifications for database change events
A ZODB database can be changed by local client as well as another process. A notification channel is thus needed for local cache and database view to know they have to update to current database state. This patch builds the interface of how such notifications should be provided by drivers. Contrary to ZODB/py it is required that every driver provide it. However we will be providing driver support incrementally and for now all drivers behave as if the database is not changing. A note on why Watchq is passed to driver as options: low-level ZODB users, who might want to work with drivers directly, might not need it, and this way with Watchq not present in driver options they will continue to observe the same driver behaviour as before watchq was introduced. In practice many low-level utilities don't need notification support, and it would be not good to required them all to update open calls and to provide watchq drainer not to get stuck. TODO Watchq should be extended to also receive errors from watcher, so that clients could be notified when there is something wrong with the database.
Showing