Ok here is what worked eventually:
On socketio definition
socketio = SocketIO(app, cors_allowed_origins="*", async_mode='threading')
(I did not have the async_mode set)
And then when initialising:
if __name__ == '__main__':
socketio.start_background_task(start_stream_consumer, r, emit_leaderboard_updates)
socketio.run(app, debug=True)
That seems to do the trick