Esempio n. 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()
Esempio n. 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()
Esempio n. 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()
Esempio n. 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()
Esempio n. 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()
Esempio n. 6
0
def create_http_server_timeout():
    server = HttpRpcServer('127.0.0.1', 10016)
    server.regist(testTimeout)
    server.regist(sayHello)
    server.serve()
Esempio n. 7
0
def create_http_server_10013():
    server = HttpRpcServer('127.0.0.1', 10013)
    server.regist(sayHello)
    server.serve()