Output messages from for loop while callback running

It isn’t. The best solution to this would be for the client to ping the backend periodically (using the dcc.Interval component). See Boilerplate Heroku Dash App for Long Processes (show and tell) - #4 by astautz for one approach created by a community member.