a thrift client pool for python
Project description
#python-thrift-pool
#base on: * python2.7 * thrift 0.9.2 thrift lib
#change 2014-12-05 : * dependency thrift 0.9.2 while using thrift-TMultiplexedProtocol
#usage
- ##install
pip install thriftpl
## using look at tests/test.py <pre> <code> # -- 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”) </code> </pre>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file thriftpl-0.2.0.zip.
File metadata
- Download URL: thriftpl-0.2.0.zip
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e6fb0f5491933039b635e86c35d1a8fdb4fc0ebae5dfd536ba386026a74ff20
|
|
| MD5 |
8ca20d9bb4a21473b736267b6631b7c2
|
|
| BLAKE2b-256 |
12a34a2d2a633d2389b37a3fab015a1655bd7a36119adc6d1d2276e61fad33a6
|