Sensu Core keepalive deregistration handler

Does anybody have a handler written to remove an host entry from Sensu based on the keepalive value? I know about the auto deregistration process; I’m more concerned now about how to handle when a client host fails and doesn’t successfully send a deregistration event. I know I can create a handler, look for a keepalive failure, look for the number of keepalive failures and then choose to call the API to remove the host.

Before I write this code, I was wondering if someone had developed this already and if I could use that code?