MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / HttpServerThread

Class HttpServerThread

test/browser_common.py:567–581  ·  view source on GitHub ↗

A generic thread class to create and run an http server.

Source from the content-addressed store, hash-verified

565
566
567class HttpServerThread(threading.Thread):
568 """A generic thread class to create and run an http server."""
569
570 def __init__(self, server):
571 super().__init__()
572 self.server = server
573
574 def stop(self):
575 """Shuts down the server if it is running."""
576 self.server.shutdown()
577
578 def run(self):
579 """Create a server instance and serve forever until stop() is called."""
580 # Start the server's main loop (this blocks until shutdown() is called)
581 self.server.serve_forever()
582
583
584# This will hold the ID for each worker process if running in parallel mode,

Callers 3

test_cross_originMethod · 0.90
setUpClassMethod · 0.85

Calls

no outgoing calls

Tested by 2

test_cross_originMethod · 0.72