BitVision
BitVision copied to clipboard
Use separate processes to do data fetching
It's really annoying when the interface thread blocks because it's executing a shell command.
https://stackoverflow.com/questions/53179920/how-to-spawn-a-child-process-without-blocking-stdin-of-parent-process-in-node-js
Our interim solution for this is just upping the refresh interval to a minute instead of every couple of seconds, so the user gets blocked less frequently.
If a solution for this can't be found, I can think of two alternatives to spawning child processes:
- We have the user host a local server that the app can make requests to and get the data that way
- Turn off auto-refreshing and instead add an option to the menubar for the user to refresh the dashboard, and when clicked, a loading modal can pop-up notifying the user that the app is refreshing and that it may take a while
I personally prefer the second over the first because while manual refreshing costs the user some time and functionality, spinning up a server every time you want to use BitVision would be a lot more annoying. Clearly the best long-term solution would be to rewrite this entire app in either Python or Node to avoid cross-language execution in the first place, but neither of us have time to do that.
@alichtman and I agreed and are going with option 2 for the alpha.