Summary:
Half way through sandy conversion I ended up redoing the task scheduling in this plugin because it was sketchy and unreliable.
Previously, it was using setInterval to schedule a task every 500ms, which would query a lot of data from the device. The problem was that if these tasks took >500ms (which they did for me at least), you'd get overlapping ones, causing havoc.
Now it uses setTimeout instead, promisifies everything, and only ever schedules the next timeout when the current task has finished.
Also fixed a race condition where you could hit stop, but not actually stop the recurring tasks... and then there was no way to stop them because it was already "stopped".
Reviewed By: mweststrate
Differential Revision: D28061469
fbshipit-source-id: 2bb8aba7ddf37ba1fdbdc52c95ec258cae96f509