Reputation: 3696
We have a flutter app that works well, but sometimes it freezes for a second or two while lots of computation is occurring.
We have a bunch of streams and listeners on the backend. Its highly reactive. Sometimes an event(s) will happen that causes many listeners to react at nearly the same time. When this happens the user cannot do anything on the front end until much of the computation has finished.
I'd like to fix this but I'm not sure how. One thing I do know is that several of our listeners (and the processes they initiate) don't really have to happen right away. I wish I could say this to some of our listeners (or, that is, specific streams), "Listen, if the computational load is heavy when you get triggered, just chill until it's low. You're not a high priority, you can wait." but I'm not familiar enough yet with dart to know how to achieve that.
Another solution I thought of was to have a dedicated thread for the front end, and force all backend computation to be contained within a separate thread. I don't think I have the option of forcing separate cores (parallelism), so maybe that wouldn't help. idk.
Can you point me in the right direction?
In the end I just want to be able to prioritize the front end above all else.
Upvotes: 0
Views: 283