Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

115
Visualizações
What is the architecture to track async http calls via react native and retry failed request?

I'm new to react native and notice the similarity with Javascript, event loop, async.

My app functionality is divided into 5 pages. One is home page, clicking on button takes to page 1. Page 1 has button, clicking on it takes user to page 2, and similarly for page 2 to page 3 and page 4 to page 5.

At each button click I am making a http POST request that uploads a text file. Fetch is inherently async so it happens in the background. This may pass or fail. If it does pass I want to record the status as pass. And if it fails then I want to record the status as failed and reattempt the upload, all this should happen without blocking the user from going into subsequent pages.

I am looking for a high level architecture to understand how to track async http calls via react native and retry failed request?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

First thing to say is, it really depends on your backend design whether the fetch really is async or not.

Eventually what holds true is, that you will have a delay for any answer, which is probably why you say it is inherently async?

Normally you can use async functions and await the answers in javascript and react or use a .then chain to wait for the resolution of your request. With that your user has to wait a second, but you can either in the background or visible for the user register the result.

If you want to use retry logic I recommend to take a look at axios and axios interceptors. With that you can check for certain error codes in the API response and call with the same request again or change the request if needed.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda