I have a question which I need pointers to how best to solve it.
So I have a Booking Class with 2 methods:
- StartBooking();
- GetBookingStatus.
These are the conditions to execute this function:
When a StartBooking() function is called and another thread or the same thread
Calls the function again, it should throw BookingInProgressException
.
When GetBookingStatus() is called by another thread when it is in progress
Should throw a ReadinProgressException.
Calling GetBookingStatus() without calling StartBooking() should throw a NoStartBookingException.
Any pointers will be really helpful.