MCPcopy Create free account
hub / github.com/RustPython/RustPython / __init__

Method __init__

Lib/multiprocessing/managers.py:765–807  ·  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

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