Ejemplo n.º 1
0
 def twisted_setup(self):
     starter = pythonstarter.LocalStarter()
     self.rpc = anycall.create_tcp_rpc_system()
     
     yield self.rpc.open()
     
     self.target = smartstarter.SmartStarter(starter, self.rpc, anycall.create_tcp_rpc_system, [], preconnect_peer="localhost:8005", factory_kwargs={"port":8005})
Ejemplo n.º 2
0
 def twisted_setup(self):
     starter = pythonstarter.LocalStarter()
     self.rpc = anycall.create_tcp_rpc_system()
     anycall.RPCSystem.default = self.rpc
     
     yield self.rpc.open()
     
     self.smart = smartstarter.SmartStarter(starter, self.rpc, anycall.create_tcp_rpc_system, [])
     self.target = worker.WorkerStarter(self.smart)
Ejemplo n.º 3
0
    def twisted_setup(self):
        starter = pythonstarter.LocalStarter()
        self.rpc = anycall.create_tcp_rpc_system()
        anycall.RPCSystem.default = self.rpc

        yield self.rpc.open()

        self.smart = smartstarter.SmartStarter(starter, self.rpc,
                                               anycall.create_tcp_rpc_system,
                                               [])
        self.target = worker.WorkerStarter(self.smart)
Ejemplo n.º 4
0
def ensure_rpcsystem():
    """
    Ensures that we have the RPC system up and running.
    Creates a TCP-based instance if required. Returns
    a deferred. Must be called from within the reactor.
    """
    if not anycall.RPCSystem.default:
        anycall.RPCSystem.default = anycall.create_tcp_rpc_system()
        rpcsystem = anycall.RPCSystem.default
        return rpcsystem.open()
        worker.make_worker("local", "master")# TODO remove network
    
    else:
        if not hasattr(anycall.RPCSystem.default, "local_worker"):
            worker.make_worker("local", "master") # TODO remove network
        defer.succeed(None)
Ejemplo n.º 5
0
def ensure_rpcsystem():
    """
    Ensures that we have the RPC system up and running.
    Creates a TCP-based instance if required. Returns
    a deferred. Must be called from within the reactor.
    """
    if not anycall.RPCSystem.default:
        anycall.RPCSystem.default = anycall.create_tcp_rpc_system()
        rpcsystem = anycall.RPCSystem.default
        return rpcsystem.open()
        worker.make_worker("local", "master")  # TODO remove network

    else:
        if not hasattr(anycall.RPCSystem.default, "local_worker"):
            worker.make_worker("local", "master")  # TODO remove network
        defer.succeed(None)
Ejemplo n.º 6
0
    def twisted_setup(self):
        starter = pythonstarter.LocalStarter()
        self.rpc = anycall.create_tcp_rpc_system()
        anycall.RPCSystem.default = self.rpc

        yield self.rpc.open()

        self.smart = smartstarter.SmartStarter(starter, self.rpc,
                                               anycall.create_tcp_rpc_system,
                                               [])
        self.starter = worker.WorkerStarter(self.smart)

        self.worker = yield self.starter.start()
        url = yield self.worker.get_function_url(try_import)
        self.try_import = self.rpc.create_function_stub(url)

        yield self.worker.reset()

        self.mockimporthook = MockImportHook({"mock_module": ("pass", False)})
        self.mockimporthook.install()
Ejemplo n.º 7
0
def create_rpc_system(conf):
    port_range = _parse_port_range(conf.get("data_ports", 0))

    return anycall.create_tcp_rpc_system(port_range=port_range)
Ejemplo n.º 8
0
 def twisted_setup(self):
     self.rpc = anycall.create_tcp_rpc_system()
     anycall.RPCSystem.default = self.rpc
     
     yield self.rpc.open()
Ejemplo n.º 9
0
    def twisted_setup(self):
        self.rpc = anycall.create_tcp_rpc_system()
        anycall.RPCSystem.default = self.rpc

        yield self.rpc.open()