Return an auto-proxy for `token`
(token, serializer, manager=None, authkey=None,
exposed=None, incref=True, manager_owned=False)
| 985 | |
| 986 | |
| 987 | def 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…