In a couple of instances, I'm unsure as to whether there exists race conditions or other issues with concurrency:
What if between here and here this discard operation executes in parallel? If this was a multithreaded environment, we'd need to use a lock to synchronise access to shared memory. Should we use any similar construct in a javascript environment with multiple timeout executions?
This loop initialises discard operations on _currentSubs that meet the correct conditions. If the timeout was set to 0, we'd essentially be mutating the array while we enumerate it (this is bad). For now, this isn't much of an issues, as its likely that any discard operations will be deferred until after the migration.
Need to understand more about how $timeout works and whether javascript or indeed angular offer any tooling to deal with concurrency in these situations.
In a couple of instances, I'm unsure as to whether there exists race conditions or other issues with concurrency:
_currentSubs
that meet the correct conditions. If the timeout was set to 0, we'd essentially be mutating the array while we enumerate it (this is bad). For now, this isn't much of an issues, as its likely that any discard operations will be deferred until after the migration.Need to understand more about how
$timeout
works and whether javascript or indeed angular offer any tooling to deal with concurrency in these situations.