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

171
Visualizações
How to manage a queue with timer and with some conditions in NodeJs?

I am creating a Taxi App, In which, when user order a taxi, three nearby driver are selected by system, and it sends a request to first driver.

Now driver will have 30sec to accept or decline the booking, if driver accepts then booking is confirmed and no other driver will be notified,

But if driver decline booking or didn't respond to the booking in 30 sec, a request will be send to second driver.

Now the problem is that, I don't know how to manage a action queue in which there are three conditions.

  1. If system don't get a reply from first driver in 30 sec, send request to next driver in queue

  2. If driver accept the booking the stop the queue process and book a ride.

  3. If driver decline the booking, then instantly send request to next driver without waiting for 30sec period.

    Any suggestion and Ideas are welcome.

about 4 years ago · Santiago Trujillo
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