BitVision icon indicating copy to clipboard operation
BitVision copied to clipboard

Use separate processes to do data fetching

Open alichtman opened this issue 7 years ago • 4 comments

It's really annoying when the interface thread blocks because it's executing a shell command.

alichtman avatar Sep 25 '18 08:09 alichtman

https://stackoverflow.com/questions/53179920/how-to-spawn-a-child-process-without-blocking-stdin-of-parent-process-in-node-js

alichtman avatar Nov 07 '18 03:11 alichtman

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.

shobrook avatar Nov 07 '18 16:11 shobrook

If a solution for this can't be found, I can think of two alternatives to spawning child processes:

  1. We have the user host a local server that the app can make requests to and get the data that way
  2. 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.

shobrook avatar Nov 07 '18 16:11 shobrook

@alichtman and I agreed and are going with option 2 for the alpha.

shobrook avatar Nov 07 '18 22:11 shobrook