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

FilterChain for each Session #75

Closed
markmandel opened this issue Jul 16, 2020 · 3 comments
Closed

FilterChain for each Session #75

markmandel opened this issue Jul 16, 2020 · 3 comments
Labels
kind/design Proposal discussing new features / fixes and how they should be implemented kind/feature New feature or request

Comments

@markmandel
Copy link
Member

Context: #69 (comment)

If you need to keep state per-session in a filter, let's create and store individual FilterChain for each Session.

We're almost all of the way there - https://github.com/googleforgames/quilkin/blob/master/src/server/sessions.rs#L41 - we can likely drop the Arc requirement from the constructor and ensure the session gets it's own owned FilterChain.

Question

Can we think of a Filter than might need to retain global state, rather than per-session, and if so, how would we manage that?

@markmandel markmandel added kind/feature New feature or request kind/design Proposal discussing new features / fixes and how they should be implemented labels Jul 16, 2020
This was referenced Jul 16, 2020
iffyio added a commit that referenced this issue Aug 16, 2020
* Add a filter chain to each session instance
* Add FilterFactory method to validate a filter's config so
  that we can validate config on startup rather than when
  later at runtime when the first session is created.
* Use Vec::truncate instead of slice::to_vec to avoid unneeded
  packet cloning.

Fixes #75
@markmandel
Copy link
Member Author

Should we close this as well, or use it as a stepping off point to discuss per-endpoint state management libraries?

(Could also do that as a new ticket too)

@iffyio
Copy link
Collaborator

iffyio commented Aug 24, 2020

It think we can close it and track state management in a new ticket

@markmandel
Copy link
Member Author

SGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/design Proposal discussing new features / fixes and how they should be implemented kind/feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants