I create a Taxi App in which, when a user orders a taxi, three neighboring drivers are selected by the system and send a request to the first driver.
Now the driver will have 30 seconds to accept or reject the reservation, if the driver accepts, the reservation is confirmed and no other driver will be notified.
But if the driver rejects the reservation or does not respond to the reservation after 30 seconds, the request will be sent to the second driver.
Now the problem is that I don’t know how to manage an action queue that has three conditions.
If the system does not receive a response from the first driver in 30 seconds, send a request to the next driver in the queue
If the driver accepts the reservation, stop the queue process and make a note of the ride.
If the driver rejects the reservation, immediately send a request for the next one without waiting for a 30 second period.
Any suggestions or ideas are welcome.
source
share