Re: getSession, componentized but not async?
Glyph Lefkowitz <[email protected]> Thu, 7 Jul 2016 15:20:45 -0700
| Newsgroups | gmane.comp.python.twisted.web |
|---|---|
| Message-ID | <[email protected]> |
--===============1471269375774250358== Content-Type: multipart/alternative; boundary="Apple-Mail=_418EF384-054B-42DD-A34C-5A72E4A20306" --Apple-Mail=_418EF384-054B-42DD-A34C-5A72E4A20306 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jul 7, 2016, at 5:14 AM, Carl Waldbieser <[email protected]> = wrote: >=20 > 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.= --Apple-Mail=_418EF384-054B-42DD-A34C-5A72E4A20306 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html = charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" = class=3D""><br class=3D""><div><blockquote type=3D"cite" class=3D""><div = class=3D"">On Jul 7, 2016, at 5:14 AM, Carl Waldbieser <<a = href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>> wrote:</div><br = class=3D"Apple-interchange-newline"><div class=3D""><span = style=3D"font-family: Menlo-Regular; font-size: 12px; font-style: = normal; font-variant-caps: normal; font-weight: normal; letter-spacing: = normal; orphans: auto; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; widows: auto; word-spacing: = 0px; -webkit-text-stroke-width: 0px; float: none; display: inline = !important;" class=3D"">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).</span><br = style=3D"font-family: Menlo-Regular; font-size: 12px; font-style: = normal; font-variant-caps: normal; font-weight: normal; letter-spacing: = normal; orphans: auto; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; widows: auto; word-spacing: = 0px; -webkit-text-stroke-width: 0px;" = class=3D""></div></blockquote></div><br class=3D""><div class=3D"">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.</div></body></html>= --Apple-Mail=_418EF384-054B-42DD-A34C-5A72E4A20306-- --===============1471269375774250358== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Twisted-web mailing list [email protected] http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web --===============1471269375774250358==--