title: What is the best practices for retry mechanism while using Retrofit?
body: <p><strong>Problem Statement:</strong></p>
  
  <p>I'm using Retrofit in my application for API calls. Currently I've 20+ Retrofit Interfaces, with different <code>Callbacks</code>. Currently when app receives <code>INVALID_SESSION_ID</code> in anyone of these Interfaces (say <code>UpdateUserAPI</code>), I've to get new <code>ACCESS_TOKEN</code>, by invoking <code>AccessTokenAPI</code>.</p>
  
  <p><strong>Approach Suggested:</strong></p>
  
  <p>When app receives <code>INVALID_SESSION_ID</code> in <code>Callback</code> in <code>UpdateUserAPI</code>, invoke <code>AccessTokenAPI</code> to get new <code>ACCESS_TOKEN</code>. Upon receiving new <code>ACCESS_TOKEN</code>, post the actual call (with initial parameters in <code>UpdateUserAPI</code>) with new <code>ACCESS_TOKEN</code>. But this requires to save parameters in the class which implements <code>UpdateUserAPI</code>. Also I need to retry getting <code>ACCESS_TOKEN</code> only once, which should be handled.</p>
  
  <p><strong>What is the best approach to implement above requirement?</strong></p>