Pacemaker provides a notification option via subscription to its daemon, where the subscriber is notified in case of changes on the CIB. A Golang implementation is available on https://github.com/ClusterLabs/go-pacemaker as a starting point.
This way, the Trento agent could have much faster response times in case of cluster events as it would not depend on polling.