代码拉取完成,页面将自动刷新
#python-thrift-pool
#base on:
#change 2014-12-05 :
##install pip install thriftpl
look at tests/test.py
# -*- coding: utf-8 -*-
import os,sys
from thriftpl.client import ThriftClientPool,ThriftClientConfig,HostAndPort,ThriftPoolConfig
from test import TestService
address = HostAndPort("127.0.0.1",9090)
poolConfig = ThriftPoolConfig(minPoolSize=1,maxPoolSize=10,maxWait=500)
clientConfig = ThriftClientConfig(clientInterface=TestService.Client)
pool = ThriftClientPool(clientConfig,poolConfig,address)
client = pool.getClient()
print client.test("123")
print client.test("1234")
print client.test("1235")
print pool.getClient().test("abc")
print pool.getClient().test("abcd")
print pool.getClient().test("abce")
from thriftpl.client import ThriftClient
client = ThriftClient(ip="127.0.0.1", port=9090, timeout=self.clientConfig.timeout,
clientInterface=TestService.Client )
client.test("test")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。