[Twisted-Python] New PB connection API

Itamar Shtull-Trauring itamar at itamarst.org
Mon Jul 28 12:35:58 MDT 2003


On 28 Jul 2003 12:53:25 -0500
pobrien at orbtech.com (Patrick K. O'Brien) wrote:

> I just converted several apps to use your new api.  It was pretty
> painless.  I'm not sure what benefit I got out of it, but since it was
> painless I'll assume it was worthwhile and will let you clean things
> up in the core.

1. You can subclass PBClientFactory and thus get, say, automatic
reconnection.
2. You can connectSSL rather than connectTCP, etc..
3. Unix sockets are no longer implemented using an evil hack.

> Related to this, I'm gearing up to covert my existing apps to use new
> cred, instead of old cred, and I'm not clear how perspectives fit into
> the new cred world-view.  Based on your new pb API, can I assume
> perspectives still have a place with PB apps?

Eventually PB will switch to new cred. This depends on some improvements
to PB tthat we are still working out. It *may* happen before 1.1 but I'm
guessing it won't :(

> Even my woven apps are using guard.PerspectiveWrapper/SessionWrapper,
> which gets a Resource object from the Perspective instance that I
> retrieve when the user logs in.  Is this a completely deprecated
> approach, or not?

Yes. But as long as you're using PB with same Perspectives you may need
to still use it.

-- 
Itamar Shtull-Trauring    http://itamarst.org/
http://www.zoteca.com -- Python & Twisted consulting




More information about the Twisted-Python mailing list