educative.io

Educative

Notifying the user that their reservation has expired

Whenever a reservation is expired, the server holding that reservation will do the following things:

  1. Update the database to remove the Booking (or mark it expired) and update the seats’ Status in ‘Show_Seats’ table.
  2. Remove the reservation from the Linked HashMap.
  3. Notify the user that their reservation has expired.
  4. Broadcast a message to all WaitingUserService servers that are holding waiting users of that Show to figure out the longest waiting user. Consistent Hashing scheme will tell what servers are holding these users.
  5. Send a message to the WaitingUserService server holding the longest waiting user to process their request if required seats have become available.

how do we notify the user that the reservation has expired? what if the user has left the page?

Hi @Dewey_Munoz

Clients can use Long Polling for keeping themselves updated for their reservation status.