Back to Parent

Improvement: Adding a coordinator

We added a webpage as an “coordinator”, which’s job is managing a waiting list and sending connect and disconnect order to those individual chairs.

When a person sits down on a chair, the chair publish a ‘sitdown’ event, and the coordinator put this chair to the end of the waiting list.

When a person leaves a chair, the chair publish a “leave” event, and the coordinator send a order to disconnect the chair if it is connected, or clear it from waiting list if it is waiting.

Every time an event is published, the coordinator will send a order to build a connection between the first and second chair in the waiting list(if there is more than one chair in the waiting list) and clear them from the waiting list. The coordinator will keep repeat this step until there is less than 2 chairs in the waiting list.


Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0