[Twisted-web] getSession, componentized but not async?

Glyph Lefkowitz glyph at twistedmatrix.com
Thu Jul 7 16:20:45 MDT 2016


> On Jul 7, 2016, at 5:14 AM, Carl Waldbieser <cwaldbieser at gmail.com> wrote:
> 
> As for persisting session data-- I guess the idea is that storing or retrieving the session object doesn't need to be async because it is just an object in memory corresponding to a cookie in the request.  However, writing to or reading from the session could definitely require async methods that talk to a back end store.  This could potentially be one area where implementing a component with an interface like `IRedisSessionStorage` might be useful (get session synchonously from request passing in IRedisStorage,  then call `storeThingInSession()` which returns a deferred).

This is an extremely subtle point so I am very happy that it seems to have somehow gotten across :).  Thanks for writing up this answer; it's close to exactly what I would have written.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-web/attachments/20160707/ce4f36cc/attachment.html>


More information about the Twisted-web mailing list