def transact(address, authkey, methodname, args=(), kwds={}): ''' Create connection then send a message to manager and return response ''' conn = Client(address, authkey=authkey) try: return dispatch(conn, None, methodname, args, kwds) finally: conn.close()
def rebuildHandle(pickled_data): from processing.connection import Client address, handle, inherited = pickled_data if inherited: return handle subDebug('rebuilding handle %d', handle) conn = Client(address, authenticate=True) conn.send((handle, os.getpid())) new_handle = recvHandle(conn) conn.close() return new_handle