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:31:16 GMT
Mark Slee wrote:
> One option here could be to have the compiler actually generate differently named objects.
i.e. you could have a TwistedServiceClient or something. That naming is pretty ugly -- maybe
do something more in line with twisted conventions (I'm not sure if there are any, I haven't
programmed in Twisted before).
> 
> But this way, your server can import gen-py.twisted.TwistedServiceClient or whatever
it is, and your client can just grab the regular stuff.
> 
> Overloading the same names seems nice but I worry it'll just create more confusion in
the long run than explicit naming would.

Just an idea in case the proposition to generate different names is
successful: maybe prepending Tx instead of Twisted, since it seems that
the official name for the twisted version of thrift is txthrift?

That said, i managed to solve my problem in the following way:

i generated twisted version i used 'thrift --gen py:twisted' whereas
when generating default version i used 'thrift --gen py:new_style'. So
there were differences not only between twisted / non-twisted stuff, but
also between classic classes declaration and new style ones.

i changed to: thrift --gen py:new_style,twisted for generating the
twisted version, and now there are differences only in the service file,
but not in the type and constant declaration files, so my modules that
are shared between client and server can have a fixed import from gen-py
and still cause no incoherence with the server code importing from
gen-py-twisted, since these modules only rely on types and constants
declarations, not on the service declaration.

cheers,

-- 
Matthieu

Mime
View raw message