macchiato-core icon indicating copy to clipboard operation
macchiato-core copied to clipboard

Make the session interface asynchronous.

Open niwinz opened this issue 8 years ago • 3 comments

The current implementation mimics the ring session middleware, that does not fits very well in nodejs environent. A great exampe can be, how I can implement a session store that uses redis. Many redis clients in node are asynchronous...

The session stores should be rethought and new, asynchronous interface should be defined in my opinion.

Ideas? Thoughts?

niwinz avatar Dec 06 '16 22:12 niwinz

I have done something similar to this on catacumba, that can be used as start point maybe: https://github.com/funcool/catacumba/blob/master/src/clojure/catacumba/handlers/session.clj

niwinz avatar Dec 06 '16 22:12 niwinz

I'd like to take a crack at this. I have a need to use redis as a session store, so I'd need an async interface.

@yogthos Any preferences on how I would extend the SessionStore protocol? Simply overload the existing methods to accept a callback? Then people can use promises/core.async as they see fit?

adamkl avatar Jul 23 '20 21:07 adamkl

Yeah that sounds reasonable to me, and thanks for taking a look.

yogthos avatar Jul 23 '20 21:07 yogthos