Set a callback to be called by a promise