More operations after a lock
I'm implementing a little test case for a session manager using couchbase as the external repository. Very briefly my idea is to implement the following flow:
1.- Session id is passed (if it's a new session it's added to couchbase).
2.- Session is locked (getAndLock)
3.- Session is managed by the user (read, modify or delete is possible).
4.- If session is modified => cas (session is saved, touched and unlocked)
5.- If session is not modified (just accessed) => touch and unlock (exp time is needed)
6.- If session is deleted => unlock and delete
My problem is in case (5) and (6) two calls are needed, in (5) you need to touch and then unlock and in (6) unlock and then delete. I want to minimize the number of couchbase calls per request so... Is it possible to have a touchAndUnlock and a delete with cas? The one that disturbs me more is case (5), cos delete seems less frequent.
I don't know if I'm saying a nonsense, but I think it'd be nice if after a lock several operations could be performed (right now there's only two possibilities cas or unlock). This is just an idea.
I wasn't sure to post here on in feature request queue.