Conversation
eece195 to
f4295df
Compare
|
@masenf do you have any idea if there is a cool way to automatically detect if |
We could also add a |
picklelo
left a comment
There was a problem hiding this comment.
Sorry for the delay here. I think the changes look good - we need to rebase this onto main and implement it for StateManagerDisk which is becoming the default in 0.7.0
No worries, I just implemented it for |
You can use it for cache invalidation, f.e. to have all blog pages as infinitely cached computed vars and invalidate/reload them globally if a page changes. Maybe we could later use it for some kind of state migration. |
|
Will rebase if there is intention to merge this |
masenf
left a comment
There was a problem hiding this comment.
the main problem i forsee with this feature is that it works great in testing/dev mode, and then once it's deployed prod with redis, some clients are not going to get deltas sent when their state is modified, because they're connected to a different instance of the app than where this API is used.
it's not a new problem, we've had it for a long time. but currently there is no mechanism for an app instance to send a delta to a client that is connected to a different instance. @Lendemor had a WiP to handle this, but i think it's closed without merging.
| raise | ||
|
|
||
|
|
||
| def get_app(reload: bool = False) -> App: |
There was a problem hiding this comment.
can we make this new function get_app_instance and leave get_app the way it was, to retain as much compatibility as possible
| The state names. | ||
| """ | ||
| for path in self._iter_pkl_files(): | ||
| token = path.stem |
There was a problem hiding this comment.
unfortunately this wont work anymore, because we started hashing the token to avoid file path limits on windows.
however, we should be able to use the same implementation here as we do for StateManagerMemory as the on-disk pickles are only read when the backend starts after a hot reload
|
Marking this as draft until ready for review. |
Thanks for the review. Yes, that's currently a limitation, but i think it can be implemented with redis pub/sub and some maps. |
|
Closing in favor of #5927 Using the new |
Uh oh!
There was an error while loading. Please reload this page.