from gi.repository import GLib, Soup


server = Soup.Server(port=8421)

def handle_new_request(server, msg, path, query, client, data):
    server.pause_message(msg)
    msg.set_status(200)
    GLib.timeout_add(5000, lambda: server.unpause_message(msg))

server.add_handler("/", handle_new_request, None)
server.run_async()

mainloop = GLib.MainLoop()
mainloop.run()
