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

let users pick state manager mode #4041

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

Lendemor
Copy link
Collaborator

@Lendemor Lendemor commented Oct 2, 2024

In rx.Config instance, you can now pass a value between "disk", "memory" or "redis" to state_manager_mode

@adhami3310
Copy link
Member

I prefer passing the StateManager subclass itself rather than an enum because that allows one to pass any subclass, including custom defined ones.

@Lendemor
Copy link
Collaborator Author

Lendemor commented Oct 2, 2024

I prefer passing the StateManager subclass itself rather than an enum because that allows one to pass any subclass, including custom defined ones.

I would be fine with this, but how would it work for setting it via env var?

@adhami3310
Copy link
Member

how would it work for setting it via env var

the developer can special case on env var they give (like if is_prod use this else use sth else), i don't think we should support direct env var to set this

@Lendemor
Copy link
Collaborator Author

Lendemor commented Oct 2, 2024

how would it work for setting it via env var

the developer can special case on env var they give (like if is_prod use this else use sth else), i don't think we should support direct env var to set this

If we define it in Config it'll automatically accept the related env var, I'm not sure we have a mechanism to exclude some config field.

@adhami3310
Copy link
Member

'll automatically accept the related env var

wild, didn't even know we had that feature

not sure we have a mechanism to exclude some config field

how would it even accept an env field for a non-trivially-serializable object like this? would it skip it?

@Lendemor
Copy link
Collaborator Author

Lendemor commented Oct 3, 2024

As a note:
Using StateManager classes directly in config doesn't work at the moment due to some circular dependencies.

Copy link
Contributor

@picklelo picklelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

@picklelo picklelo merged commit 6f586c8 into main Oct 10, 2024
31 checks passed
Kastier1 pushed a commit that referenced this pull request Oct 23, 2024
@masenf masenf deleted the lendemor/easy_switch_between_state_manager branch December 12, 2024 07:15
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

Successfully merging this pull request may close these issues.

3 participants