[Twisted-Python] Must avatarId always be a string?

Glyph glyph at twistedmatrix.com
Tue Jan 15 14:13:31 EST 2013

On Jan 14, 2013, at 11:39 PM, Hynek Schlawack <hs at ox.cx> wrote:

> Am 14.01.2013 um 23:58 schrieb Glyph <glyph at twistedmatrix.com>:
>>>> It seems like the "shared caching reference" would solve this problem
>>>> as well?
>>> Yes, I think that's the right answer. It's certainly the right design
>>> in my case, and perhaps in the general case too.
>> I think that this is the right design for now, given the constraints of the current cred API; however, it's certainly possible we could think up an extension to the cred API that would make this case easier to deal with.  It also leaves open some not-quite-trivial questions like "how do you know when to expire the cache, which are usually easy to work out for a particular application but do not generalize easily.
> I was under the impression that the IRealm.requestAvatar() is *always* called *once* after ICredentialsChecker.requestAvatarId() so I simply delete the data from the cache once my avatar is created (and it works fine).
> Am I presuming something I shouldn’t?

No, you're correct.  But, if you're using directory information for other purposes, perhaps you would want to expire it later.  Hence, hard to generalize.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20130115/17cfa171/attachment.htm 

More information about the Twisted-Python mailing list