Exemple #1
0
def create_http_server_timeout():
    from agileutil.rpc.server import HttpRpcServer
    server = HttpRpcServer('127.0.0.1', 10016)
    server.disableLog()
    server.regist(testTimeout)
    server.regist(sayHello)
    server.serve()
Exemple #2
0
def create_http_server_discovery():
    from agileutil.rpc.server import HttpRpcServer
    from agileutil.rpc.discovery import DiscoveryConfig
    server = HttpRpcServer('127.0.0.1', 10003)
    server.disableLog()
    disconf = DiscoveryConfig(
        consulHost=CONSUL_HOST,
        consulPort=CONSUL_PORT,
        serviceName='test-http-rpc-server',
        serviceHost=local_ip(),
        servicePort=10003,
    )
    server.setDiscoverConfig(disconf)
    server.regist(sayHello)
    server.serve()
Exemple #3
0
def create_http_server_compress():
    from agileutil.rpc.server import HttpRpcServer
    from agileutil.rpc.compress import RpcCompress
    RpcCompress.DEBUG = True
    RpcCompress.enableCompressLen = 200
    server = HttpRpcServer('127.0.0.1', 10021)
    server.disableLog()
    server.regist(sayHello)
    server.serve()
Exemple #4
0
def create_http_server_discovery():
    if not IS_TEST_DISCOVERY: return
    server = HttpRpcServer('127.0.0.1', 10003)
    disconf = DiscoveryConfig(
        consulHost=CONSUL_HOST,
        consulPort=CONSUL_PORT,
        serviceName='test-http-rpc-server',
        serviceHost=local_ip(),
        servicePort=10003,
    )
    server.setDiscoverConfig(disconf)
    server.regist(sayHello)
    server.serve()
Exemple #5
0
def create_http_server_compress():
    RpcCompress.DEBUG = True
    RpcCompress.enableCompressLen = 200
    server = HttpRpcServer('127.0.0.1', 10021)
    server.regist(sayHello)
    server.serve()
Exemple #6
0
def create_http_server_timeout():
    server = HttpRpcServer('127.0.0.1', 10016)
    server.regist(testTimeout)
    server.regist(sayHello)
    server.serve()
Exemple #7
0
def create_http_server_10013():
    server = HttpRpcServer('127.0.0.1', 10013)
    server.regist(sayHello)
    server.serve()