MCPcopy Index your code
hub / github.com/python/cpython / _run_server

Method _run_server

Lib/multiprocessing/managers.py:583–603  ·  view source on GitHub ↗

Create a server, report its address and run it

(cls, registry, address, authkey, serializer, writer,
                    initializer=None, initargs=())

Source from the content-addressed store, hash-verified

581
582 @classmethod
583 def _run_server(cls, registry, address, authkey, serializer, writer,
584 initializer=None, initargs=()):
585 '''
586 Create a server, report its address and run it
587 '''
588 # bpo-36368: protect server process from KeyboardInterrupt signals
589 signal.signal(signal.SIGINT, signal.SIG_IGN)
590
591 if initializer is not None:
592 initializer(*initargs)
593
594 # create server
595 server = cls._Server(registry, address, authkey, serializer)
596
597 # inform parent process of the server's address
598 writer.send(server.address)
599 writer.close()
600
601 # run the manager
602 util.info('manager serving at %r', server.address)
603 server.serve_forever()
604
605 def _create(self, typeid, /, *args, **kwds):
606 '''

Callers

nothing calls this directly

Calls 5

initializerFunction · 0.85
sendMethod · 0.45
closeMethod · 0.45
infoMethod · 0.45
serve_foreverMethod · 0.45

Tested by

no test coverage detected