Skip to content
This repository has been archived by the owner on Nov 22, 2018. It is now read-only.

Asynchronous version of Session.Get & Session.Set #21

Closed
hishamco opened this issue Mar 26, 2015 · 2 comments
Closed

Asynchronous version of Session.Get & Session.Set #21

hishamco opened this issue Mar 26, 2015 · 2 comments
Labels

Comments

@hishamco
Copy link
Contributor

As we know that there many session management techniques are present such as InMemory, Distributed or even Database, some of them may takes long time to get or set the values in the store, indeed we need to support async as first class

@kichalla
Copy link
Member

@hishamco : We did discuss about this in our team and felt that exposing async apis for Get and Set would not give a good user experience. More details below:

  1. Session.Get("key1") -> if the session is not loaded already, then its loaded and would be a synchronous call
  2. Session.Get("key2") -> This call would not be over the network as all the session data has already been loaded into memory and would just be an in-memory lookup for this key.

To avoid making the the blocking call in step 1. above, you could do something like:

  1. await Session.LoadAsync(); -> async call after which all the data related to current session is loaded into memory.
  2. Session.Get("key1") -> in-memory lookup
  3. Session.Get("key2") -> in-memory lookup

@hishamco
Copy link
Contributor Author

Thanks for clarification @kichalla, also I have seen a related issue #31 if i'm not wrong

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants