Skip to main content
Help us improve Python packaging – donate today!

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>

Release history Release notifications

This version
History Node

0.2.0

History Node

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
thriftpl-0.2.0.zip (8.2 kB) Copy SHA256 hash SHA256 Source None May 25, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page