Use listeners to trigger actions in 3rd party applications

is there a way of using what’s in the notifications package of docker distribution to trigger events in 3rd party applications? I’d like a script to run when an image is pushed up to the registry (either a new image or an update to an existing image).

As a follow up question, are the listeners/events triggered when the push to the registry is requested or when the push is complete?

Thanks in advance!