thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu Imbert <matthieu.imb...@ens-lyon.fr>
Subject Re: thrift + python twisted
Date Mon, 06 Jul 2009 21:44:54 GMT
Esteve Fernandez wrote:
> Hi Matthieu
> 
> Just move your service modules to another directory, and import them from both 
> the client and the server. However, I think the Thrift compiler should write 
> the Twisted stuff to another directory (e.g. gen-py.twisted), I believe your 
> case (standard Python and Twisted code in the same project) is fairly common. 
> What do others think?
> 
> Anyway, I attached and uploaded an example based on the one from the tutorial 
> to:
> 
> http://fluidinfo.com/esteve/stuff/txthrift_client.py
> http://fluidinfo.com/esteve/stuff/txthrift_server.py
> 
>> By the way, thanks all the thrift team for the great software, and
>> Esteve for the twisted stuff.
> 
> Let us know if the above solution works for you and don't hesitate to share 
> with us any issue you find :-)
> 
> Cheers.

As i explain in my answer to Mark, i finally could get it to work.

However i noticed someting interresting: i have some client test code
that at some point calls a server function with as parameter a list of
structures of size 10000. This worked perfecly well with the default
server implementation, but it raises a socket error exception when
connecting to the twisted thrift server implementation. The only
difference in the client code is using TFramedTransport instead of
TBufferedTransport. If i reduce the size of the list to 3000 items
instead of 10000, it works well.

the declaration of the function and the structures contained in the list
are:

struct Timestamp {
  1: i32 s = -2147483648,
  2: i32 micro_s = 0,
}

struct Measure {
  1: Timestamp ts,
  2: optional i32 i32_val,
  3: optional i64 i64_val,
  4: optional double double_val,
  5: optional string string_val,
  6: optional bool bool_val,
}

void foo(1: string id1, 2: string id2, 3: list<Measure> measures)

Is there any known size limitations with TFramedTransport that are lower
than with TBufferedTransport?

Apart from this particular call with a huge list, there are currently no
problem running my test code with the twisted thrift implementation.

cheers,

-- 
Matthieu

Mime
View raw message