> Currently we have two possible designs:
>
> Design 1:
> The session is stored as an mutable atom map in (request :session). To
> update the session, use the standard Clojure swap! function, e.g.
>
> Design 2:
> The session is an immutable map in (request :session). To update the
> session, add the updated session to the response, e.g.

I prefer design 1. As much as I would like to think of (request ->
response) as a pure function, there are often other things going on
such as talking to a database. What if the session is changed by two
requests that are being handled simultaneously? Ring can't
automatically re-try because then a database update may be repeated.

With the same issue in mind, I propose design 3. Like design 1 except
(ref {}) instead of (atom {}) because I may want to coordinate changes
between the session and some other transaction-aware state.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to