scala - Retrieve session information from request inside an actor? -


so i'm new scala, play, , akka.

i have play endpoint has action. action send incoming json actor1 parses , validates json, , sends parsed json object actor2 work data. keep going, maybe actor2 sends messages actor3 or maybe actor4. problem is, when i'm inside these actors, need way information session, userid.

here questions:

  1. does play manage request context these being run in inside actors can somehow retrieve session information inside actors without having pass through each message?
  2. play manages sort of context request while passing messages actors right? if i'm not mistaken database transactions, database operations in separate threads performed in same database transaction, , committed upon sending response. possibly attach session information context well?
  3. could use scala implicits pass around in way clean?

  1. no. play stateless web framework, if want request, you'll have include in message passed actor.

  2. play doesn't handle transactions automatically, nor can use transaction across multiple actors.

  3. yes, could, use case don't see need actors.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -