Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent state between RPC requests #138

Open
richardartoul opened this issue Jul 2, 2017 · 1 comment
Open

Persistent state between RPC requests #138

richardartoul opened this issue Jul 2, 2017 · 1 comment

Comments

@richardartoul
Copy link

I know this isn't part of the WAMP spec, but it would be a nice feature to support persisting some amount of state between RPC requests. The example I have in mind is that I'm authenticating users WAMP sessions with API keys. Once the WAMP connection is established, I don't want to have to hit the database everytime I receive an RPC to lookup which user is associated with the API key.

If I was using traditional websockets it would be trivial to cache the user in local scope for some amount of time such that only the associated websocket connection has access to it.

The existing turnpike interface makes doing this fairly difficult.

What are your thoughts? I'm happy to take a stab at implementing the feature, just want confirmation that it would be considered useful / merged if I did so.

@richardartoul
Copy link
Author

The alternative to building a way of storing state with the sessions would be to make it easier to expose the session id in the RPC method. I think the way this is intended to work in Turnpike is by having the client send a "disclose_me" option, but this field appears to be deprecated (the Autobahn Python library no longer supports it for example), so this doesn't leave a lot of room for doing this any other way.

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

No branches or pull requests

1 participant