build server in web build, and make main loop async there