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

Function AutoProxy

Lib/multiprocessing/managers.py:987–1010  ·  view source on GitHub ↗

Return an auto-proxy for `token`

(token, serializer, manager=None, authkey=None,
              exposed=None, incref=True, manager_owned=False)

Source from the content-addressed store, hash-verified

985
986
987def AutoProxy(token, serializer, manager=None, authkey=None,
988 exposed=None, incref=True, manager_owned=False):
989 '''
990 Return an auto-proxy for `token`
991 '''
992 _Client = listener_client[serializer][1]
993
994 if exposed is None:
995 conn = _Client(token.address, authkey=authkey)
996 try:
997 exposed = dispatch(conn, None, 'get_methods', (token,))
998 finally:
999 conn.close()
1000
1001 if authkey is None and manager is not None:
1002 authkey = manager._authkey
1003 if authkey is None:
1004 authkey = process.current_process().authkey
1005
1006 ProxyType = MakeProxyType('AutoProxy[%s]' % token.typeid, exposed)
1007 proxy = ProxyType(token, serializer, manager=manager, authkey=authkey,
1008 incref=incref, manager_owned=manager_owned)
1009 proxy._isauto = True
1010 return proxy
1011
1012#
1013# Types/callables which we will register with SyncManager

Callers

nothing calls this directly

Calls 3

MakeProxyTypeFunction · 0.85
dispatchFunction · 0.70
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…