def setUp(self): self.engines = [] self.controller = cs.ControllerService() self.controller.startService() self.imultiengine = me.IMultiEngine(self.controller) self.itc = taskmodule.ITaskController(self.controller) self.itc.failurePenalty = 0 self.mec_referenceable = IFCSynchronousMultiEngine(self.imultiengine) self.tc_referenceable = IFCTaskController(self.itc) self.controller_tub = Tub() self.controller_tub.listenOn('tcp:10105:interface=127.0.0.1') self.controller_tub.setLocation('127.0.0.1:10105') mec_furl = self.controller_tub.registerReference(self.mec_referenceable) tc_furl = self.controller_tub.registerReference(self.tc_referenceable) self.controller_tub.startService() self.client_tub = ClientConnector() d = self.client_tub.get_multiengine_client(mec_furl) d.addCallback(self.handle_mec_client) d.addCallback(lambda _: self.client_tub.get_task_client(tc_furl)) d.addCallback(self.handle_tc_client) return d
def setUp(self): self.engines = [] self.controller = ControllerService() self.controller.startService() self.imultiengine = IMultiEngine(self.controller) self.mec_referenceable = IFCSynchronousMultiEngine(self.imultiengine) self.controller_tub = Tub() self.controller_tub.listenOn('tcp:10105:interface=127.0.0.1') self.controller_tub.setLocation('127.0.0.1:10105') furl = self.controller_tub.registerReference(self.mec_referenceable) self.controller_tub.startService() self.client_tub = ClientConnector() d = self.client_tub.get_multiengine_client(furl) d.addCallback(self.handle_got_client) return d
""" __docformat__ = "restructuredtext en" #------------------------------------------------------------------------------- # Copyright (C) 2008 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # Imports #------------------------------------------------------------------------------- from IPython.kernel import codeutil from IPython.kernel.clientconnector import ClientConnector # Other things that the user will need from IPython.kernel.task import MapTask, StringTask from IPython.kernel.error import CompositeError #------------------------------------------------------------------------------- # Code #------------------------------------------------------------------------------- _client_tub = ClientConnector() get_multiengine_client = _client_tub.get_multiengine_client get_task_client = _client_tub.get_task_client get_client = _client_tub.get_client