Custom Upgrade Strategy

Is there a way to write a customized upgrade strategy that waits for something and then upgrades each container in a service instead of a static interval?