softwaremill / akka-http-session

Web & mobile client-side akka-http sessions, with optional JWT support

Home Page:https://softwaremill.com/open-source/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

non blocking interface

MasseGuillaume opened this issue · comments

setSession implies a blocking interface. It would be nice if it could accept a Future[T]

In what sense is setSession blocking? If you have a future value, you can use onSuccess (a standard akka-http directive) to unwrap the value:

onSuccess(myFuture) { sessionContent =>
   setSession(sesisonContent) {
      // ...
   }
}

You could also easily make your own future-accepting directive. Does that work for you?

Oh perfect I didn't know this one existed