Skip to content

client: Clean up implementation of Pause action and fix double wait

Clément Pit-Claudel requested to merge cpc/pause into main
  • js/src/main/scala/cs214/webapp/client/StateMachineClientApp.scala:
    (processing): New Boolean indicating that an event loop is running.
    (timeout, setCooldown, tryProcessNextAction): Remove.
    (processActions): New function: start an event loop, setting processing to true while traversing actionsQueue. Recurse through a future to allow individual actions to delay the next iteration of the event loop.
    (processAction): Return a Future to let individual actions handle timeouts.
    (after): New function: Expose setTimeout as a Future.

Reported-by: Simon Lefort androz2091@gmail.com

Edited by Clément Pit-Claudel

Merge request reports

Loading