title: Call refreshtoken WS only once with RX
body: <p>On a screen i have multiple WS called with a token, when token is expired, a function called refreshTokens is called :</p>
  <pre><code>  func postItemImpersonation(parameters: [String: Any]?) -&gt; Observable&lt;(HTTPURLResponse, T)&gt; {
      let absolutePath = Constants.URL.Impersonation.url
      let impersonationHeader: [String: String] = [
      &quot;Content-Type&quot;: &quot;application/json&quot;,
      &quot;X-Api-Key&quot;: &quot;xxxxxxx&quot;
      ]
      return self.manager.rx.request(.post, absolutePath, parameters: parameters, encoding: JSONEncoding.default, headers: impersonationHeader)
          .responseJSON()
          .timeout(RxTimeInterval.seconds(self.timeOutValue), scheduler: scheduler)
          .observeOn(self.scheduler)
          .map({ response -&gt; (HTTPURLResponse, T) in
              if response.response?.statusCode == 500 {
                  throw Error_Code_Network.REST_KO_TECHNIQUE_ERROR
              }
              else if response.response?.statusCode == 204 {
                  throw Error_Code_Network.REST_NO_CONTENT
              }else if response.response?.statusCode == 401 {
                 
                  throw TokenError.unauthorized
              }
              
              let object = Mapper&lt;T&gt;().map(JSONObject: response.value)
              if let object = object, let response = response.response {
                  return (response, object)
              }
              throw Error_Code_Network.REST_KO_TECHNIQUE_ERROR
          })
          .retryWhen({ errorObservable in
              errorObservable.enumerated().flatMap({ ( index , error ) -&gt; Observable&lt;Void&gt; in
                  if let e = error as? TokenError, e == TokenError.unauthorized, index &lt; self.maxRequestRetry {
                      return self.refreshTokens().asObservable()
                          .map({ succeded -&gt; Void in
                              if succeded {
                                  return Void()
                              } else {
                                  SessionManager.GetInstance().forceDeconnexion.accept(true)
                                  throw TokenError.expired
                              }
                          })
                  }
                  throw error
              })
          })
  }
  </code></pre>
  <p>}</p>
  <p>but when two ws or more are called and token expired, refreshTokens is called several times, i want it to be called only once</p>
  <p>how can i do that please ?</p>