Skip to content

Instantly share code, notes, and snippets.

@isen0011
Last active July 6, 2023 13:57
Show Gist options
  • Save isen0011/5733125317910c1a4acf45c2841b6357 to your computer and use it in GitHub Desktop.
Save isen0011/5733125317910c1a4acf45c2841b6357 to your computer and use it in GitHub Desktop.
Ember queue signage notes

Ember queue signage notes

Core overall function: Listen to messages from Faye about changes to the queue or people being called. When getting a message, normalize the incoming message data, and update the display based on the new data.

If several people are called at once, things get tricky so that we can allow each student some time displayed on the calling screen.

Weirdness with the calling logic to aviod collisions

The calling aviodence logic is here: https://github.umn.edu/asrweb/queue_signage/blob/9659a7fd5d96c53b2c34d4673a66e9c082c83c69/app/routes/visitors.js#L56

There is some weirdness here with the multiplier. A better name might be one less than the number of people who have been called to the counter. We use multiplier to ensure that every "calling" message is displayed for a set length of time before the next "calling" message gets to show, and that we give a period of time between the messages where we show the current state of the queue. As more people get called, the multiplier gets increased. As people are done being called to the counter, multiplier gets decreased. When displaying the "calling" messages, we set the time to start and stop displaying the message based on pre-set offsets times the multiplier. We set it at one less that the number of people who have been called to the counter so that when the first person is called, multiplier is 0 - and thus the delay times are also 0.

Where the templates are

Check out the following for details on the layout of the calling and visitors pages: https://github.umn.edu/asrweb/queue_signage/tree/master/app/templates

Where the message handling happens

This is where we handle the incoming messages & their payloads https://github.umn.edu/asrweb/queue_signage/blob/master/app/services/message-handler.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment