Exemplo n.º 1
0
def rpc_server(transport, target, wait_before_answer, executor, show_stats):
    endpoint_cls = RpcEndpointMonitor if show_stats else RpcEndpoint
    endpoints = [endpoint_cls(wait_before_answer)]
    server = rpc.get_rpc_server(transport, target, endpoints,
                                executor=executor)
    server.start()
    server.wait()
Exemplo n.º 2
0
 def _start_server(self, transport, target, messages):
     server = rpc.get_rpc_server(transport,
                                 target, [RpcEndpoint(messages)],
                                 executor='eventlet')
     server.start()
     while 1:
         time.sleep(3)
Exemplo n.º 3
0
def rpc_server(transport, wait_before_answer):
    endpoints = [RpcEndpoint(wait_before_answer)]
    target = messaging.Target(topic='t1', server='moi')
    server = rpc.get_rpc_server(transport, target,
                                endpoints, executor='eventlet')
    server.start()
    server.wait()
Exemplo n.º 4
0
def rpc_server(transport, target, wait_before_answer, executor, show_stats):
    endpoints = [RpcEndpoint(wait_before_answer, show_stats)]
    server = rpc.get_rpc_server(transport,
                                target,
                                endpoints,
                                executor=executor)
    server.start()
    server.wait()
Exemplo n.º 5
0
def rpc_server(transport, target, wait_before_answer, executor, duration):
    endpoints = [RpcEndpoint(wait_before_answer)]
    server = rpc.get_rpc_server(transport, target, endpoints,
                                executor=executor)
    LOG.debug("starting RPC server for target %s", target)

    run_server(server, duration=duration)

    return server.dispatcher.endpoints[0]
Exemplo n.º 6
0
def rpc_server(transport, wait_before_answer):
    endpoints = [RpcEndpoint(wait_before_answer)]
    target = messaging.Target(topic='t1', server='moi')
    server = rpc.get_rpc_server(transport,
                                target,
                                endpoints,
                                executor='eventlet')
    server.start()
    server.wait()
Exemplo n.º 7
0
def rpc_server(transport, target, wait_before_answer, executor, show_stats,
               duration):
    endpoints = [RpcEndpoint(wait_before_answer, show_stats)]
    server = rpc.get_rpc_server(transport, target, endpoints,
                                executor=executor)
    LOG.debug("starting RPC server for target %s", target)
    run_server(server, duration=duration)
    LOG.info("Received total messages: %d",
             server.dispatcher.endpoints[0].messages_received)
Exemplo n.º 8
0
def rpc_server(transport, target, wait_before_answer, executor, duration):
    endpoints = [RpcEndpoint(wait_before_answer)]
    server = rpc.get_rpc_server(transport, target, endpoints,
                                executor=executor)
    LOG.debug("starting RPC server for target %s", target)

    run_server(server, duration=duration)

    return server.dispatcher.endpoints[0]
Exemplo n.º 9
0
def rpc_server(transport, target, wait_before_answer, executor, duration):

    endpoints = [RpcEndpoint(wait_before_answer)]
    server = rpc.get_rpc_server(transport, target, endpoints, executor)

    # make the rpc server controllable by rpc clients
    endpoints.append(ServerControlEndpoint(server))

    LOG.debug("starting RPC server for target %s", target)

    run_server(server, duration=duration)

    return server.dispatcher.endpoints[0]
Exemplo n.º 10
0
def rpc_server(transport, target, wait_before_answer, executor, duration):

    endpoints = [RpcEndpoint(wait_before_answer)]
    server = rpc.get_rpc_server(transport, target, endpoints, executor)

    # make the rpc server controllable by rpc clients
    endpoints.append(ServerControlEndpoint(server))

    LOG.debug("starting RPC server for target %s", target)

    run_server(server, duration=duration)

    return server.dispatcher.endpoints[0]
Exemplo n.º 11
0
def rpc_server(transport, target, wait_before_answer, executor, show_stats,
               duration):
    endpoints = [RpcEndpoint(wait_before_answer, show_stats)]
    server = rpc.get_rpc_server(transport, target, endpoints,
                                executor=executor)
    LOG.debug("starting RPC server for target %s", target)
    server.start()
    if duration:
        start_t = time.time()
        while time.time() - start_t < duration:
            time.sleep(1)
        server.stop()
        server.wait()
        LOG.info("Received total messages: %d",
                 server.dispatcher.endpoints[0].messages_received)
        return
    server.wait()
Exemplo n.º 12
0
def rpc_server(transport, target, wait_before_answer, executor, show_stats,
               duration):
    endpoints = [RpcEndpoint(wait_before_answer, show_stats)]
    server = rpc.get_rpc_server(transport,
                                target,
                                endpoints,
                                executor=executor)
    LOG.debug("starting RPC server for target %s", target)
    server.start()
    if duration:
        start_t = time.time()
        while time.time() - start_t < duration:
            time.sleep(1)
        server.stop()
        server.wait()
        LOG.info("Received total messages: %d",
                 server.dispatcher.endpoints[0].messages_received)
        return
    server.wait()
Exemplo n.º 13
0
def rpc_server(transport, target, wait_before_answer, executor, show_stats):
    endpoints = [RpcEndpoint(wait_before_answer, show_stats)]
    server = rpc.get_rpc_server(transport, target, endpoints,
                                executor=executor)
    server.start()
    server.wait()
Exemplo n.º 14
0
 def _start_server(self, transport, target, messages):
     server = rpc.get_rpc_server(transport, target, [RpcEndpoint(messages)], executor="eventlet")
     server.start()
     while 1:
         time.sleep(3)
Exemplo n.º 15
0
 def _start_server(self, transport, target):
     server = rpc.get_rpc_server(transport, target, [RpcEndpoint()],
                                 executor='eventlet')
     server.start()
     while 1:
         time.sleep(3)