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

Method __init__

Lib/multiprocessing/managers.py:766–808  ·  view source on GitHub ↗
(self, token, serializer, manager=None,
                 authkey=None, exposed=None, incref=True, manager_owned=False)

Source from the content-addressed store, hash-verified

764 _next_serial = 1
765
766 def __init__(self, token, serializer, manager=None,
767 authkey=None, exposed=None, incref=True, manager_owned=False):
768 with BaseProxy._mutex:
769 tls_serials = BaseProxy._address_to_local.get(token.address, None)
770 if tls_serials is None:
771 tls_serials = util.ForkAwareLocal(), ProcessLocalSet()
772 BaseProxy._address_to_local[token.address] = tls_serials
773
774 self._serial = BaseProxy._next_serial
775 BaseProxy._next_serial += 1
776
777 # self._tls is used to record the connection used by this
778 # thread to communicate with the manager at token.address
779 self._tls = tls_serials[0]
780
781 # self._all_serials is a set used to record the identities of all
782 # shared objects for which the current process owns references and
783 # which are in the manager at token.address
784 self._all_serials = tls_serials[1]
785
786 self._token = token
787 self._id = self._token.id
788 self._manager = manager
789 self._serializer = serializer
790 self._Client = listener_client[serializer][1]
791
792 # Should be set to True only when a proxy object is being created
793 # on the manager server; primary use case: nested proxy objects.
794 # RebuildProxy detects when a proxy is being created on the manager
795 # and sets this value appropriately.
796 self._owned_by_manager = manager_owned
797
798 if authkey is not None:
799 self._authkey = process.AuthenticationString(authkey)
800 elif self._manager is not None:
801 self._authkey = self._manager._authkey
802 else:
803 self._authkey = process.current_process().authkey
804
805 if incref:
806 self._incref()
807
808 util.register_after_fork(self, BaseProxy._after_fork)
809
810 def _connect(self):
811 util.debug('making connection to manager')

Callers

nothing calls this directly

Calls 3

_increfMethod · 0.95
ProcessLocalSetClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected