Custom Retry Policy

How would I go about implementing a custom retry policy?