Well we are all done with our orders and ticket service for now we've got a bunch of publishers.
Listeners wrote handlers inside about them at this point there's definitely a couple of different directions
we could go.
We could go back over to our client project and start to put together the front end for creating orders
and tickets and all that stuff.
But for the rest this course to be honest with you really going to stick on the back end.
And we're only going to revisit the react application when just about all of our backend stuff is done.
That is the real focus of this course overall.
It is really the back end component as opposed to just kind of juggling data in the world of react so
on the back inside.
What is the next thing we're going to do.
Well we're going to take a look at that idea of expiring in order after some period of time.
So this is going to be referred to as the expiration service.
This service is going to have one single job.
It is going to watch for order created coming in.
So we're going to definitely implement a listener inside there and then after that 15 minute timer or
however long we eventually configure it to be we're going to the expiration service then publish an
event of its own called simply expiration.
Complete the goal of this event right here is to tell the order service that one of its orders has now
expired.
Now one thing I want to really highlight that's in this diagram right here.
The expiration service is not responsible for telling the rest of the world then order has been canceled.
That's not his job.
Its sole purpose is to have that 15 minute timer.
It is then up to the order service to take a look at this event and decide whether or not it is actually
time to cancel an order.
This is really important because when this event comes into the Weather Service a user may have already
paid for it in order and we might have not gone over to the expiration service and told it that the
order was paid for and then it should cancel that timer so all this service really does for us.
Listen to order created image expiration complete after 15 minutes or so.
The service is going to be pretty straightforward in nature and certainly a lot easier to put together
than all the other services we put together so far.
It's not gonna have any root handlers won't have any express server nothing like that.
It's really just a listener and a publisher.
Now having said all that of course there's always some hidden complexity.
Always always always.
So the real question about the service comes down to how are we going to let that 15 minute timer lapse.
How are we gonna keep track of it and how are we gonna make sure that we emit an event precisely 15
minutes after.
Well that's a big question.
We've got a couple of different options available to us.
So let's take a pause right here.
We're going to take a look at four or five I think four different options of how we can implement that
timer inside the expiration service.