allows cancelling an operation mid-calculation by calling .terminate() on the webworker and sending it to the withoutWorker state.
There it immediately enters the withWorker state again that has a service that sets up and starts listening to a new worker.
If a day is chosen while calculating, terminate, set the new day immediately and send to withoutWorker state.
If a file is chosen while calculating, terminate, add the file to a queue and send to withoutWorker state. Once the worker is ready end enters the idle state, that queue is checked. If a file is in there, it reads that file (goes to the readFile state).
allows cancelling an operation mid-calculation by calling
.terminate()
on the webworker and sending it to thewithoutWorker
state. There it immediately enters thewithWorker
state again that has a service that sets up and starts listening to a new worker.If a day is chosen while calculating, terminate, set the new day immediately and send to
withoutWorker
state. If a file is chosen while calculating, terminate, add the file to a queue and send towithoutWorker
state. Once the worker is ready end enters theidle
state, that queue is checked. If a file is in there, it reads that file (goes to thereadFile
state).