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: per-connexion state with txthrift
Date Sun, 14 Feb 2010 10:20:46 GMT
Matthieu Imbert wrote:
> It seems to be a half-working solution since I don't see how i can then access this data
from the thrift handler (which is shared by all incoming client connexions).
> 
> For example, how could i access this protocol.connection_id from one of the thrift function
handler of the MyHandler instance, in my previous example?

Actually, this issue is not specific to the txthrift (twisted-thrift) python generated code,
but also to the regular python generated code, since in both cases the thrift server handler
is shared between all connexions, and has (to the best of my knowledge) no way to access a
connexion object.

I think this can be a huge problem for a lot of use cases. For example, it seems difficult
to implement any form of authentification (at least a per-connexion authentification, as is
usually the case) since it will be impossible to attach any authentication token to the session.

I can also quickly imagine a lot of scenarios where not being able to maintain some per-connexion
state is an issue. Imagine for example a simple RPN calculator service (with 3 functions:
push, pop, add): how can one maintain a per-connexion stack?

I don't know if other thrift language bindings suffer from the same limitation? (so far, i've
only implemented a server in python)

cheers,

-- 
Matthieu

Mime
View raw message