Running calculation-heavy process in background?

Just as a reply to my own comment, to further clear things up:

I see 2 possible solutions:

Have the server run 2 parallel python sessions. One for the dash app & gunicorn workers, one for the model calculation. A button press sends the model parameters to the model process (I don’t know how yet, but there should be a solution). the model process has a queue of incoming calls and runs them through, writing intermediate and final results into some DB (granted, must not be SQLLite).

Have just one python process which runs both the dash app & gunicorn workers. A button press triggers a function which continuosly runs in the background while writing gradual results to a db. The question is: Can Dash handle a process which runs in the background? Can dash query results from a DB while another part of its code is computing results? Or do I have to implement some strange callback loop?