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