When I program apps, usually I need to do something that can fail (the most typical is send something to a server), many times the "send and forget" would be the best option (or a send and forget with a expiration date).
I know it is a very generic problem but is there some library that facilitates the save and retry process?