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

Method _callmethod

Lib/multiprocessing/managers.py:819–850  ·  view source on GitHub ↗

Try to call a method of the referent and return a copy of the result

(self, methodname, args=(), kwds={})

Source from the content-addressed store, hash-verified

817 self._tls.connection = conn
818
819 def _callmethod(self, methodname, args=(), kwds={}):
820 '''
821 Try to call a method of the referent and return a copy of the result
822 '''
823 try:
824 conn = self._tls.connection
825 except AttributeError:
826 util.debug('thread %r does not own a connection',
827 threading.current_thread().name)
828 self._connect()
829 conn = self._tls.connection
830
831 conn.send((self._id, methodname, args, kwds))
832 kind, result = conn.recv()
833
834 if kind == '#RETURN':
835 return result
836 elif kind == '#PROXY':
837 exposed, token = result
838 proxytype = self._manager._registry[token.typeid][-1]
839 token.address = self._token.address
840 proxy = proxytype(
841 token, self._serializer, manager=self._manager,
842 authkey=self._authkey, exposed=exposed
843 )
844 conn = self._Client(token.address, authkey=self._authkey)
845 dispatch(conn, None, 'decref', (token.id,))
846 return proxy
847 try:
848 raise convert_to_error(kind, result)
849 finally:
850 del result # break reference cycle
851
852 def _getvalue(self):
853 '''

Callers 15

_getvalueMethod · 0.95
__str__Method · 0.95
__next__Method · 0.80
__next__Method · 0.80
commonMethod · 0.80
__next__Method · 0.80
sendMethod · 0.80
throwMethod · 0.80
closeMethod · 0.80
acquireMethod · 0.80
releaseMethod · 0.80
lockedMethod · 0.80

Calls 6

_connectMethod · 0.95
convert_to_errorFunction · 0.85
dispatchFunction · 0.70
debugMethod · 0.45
sendMethod · 0.45
recvMethod · 0.45

Tested by 2

__next__Method · 0.64
commonMethod · 0.64