-
Notifications
You must be signed in to change notification settings - Fork 62
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
Use environments for Connect content + user caches #667
Conversation
R/board_rsconnect.R
Outdated
rsconnect_content_cache_env <- rlang::new_environment() | ||
rsconnect_user_cache_env <- rlang::new_environment() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put these here? And also I think it's simplest to still have two of them, one for the pieces of content and one for the users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a totally reasonable approach but we're starting to build a bit of a consensus around using the
as a sentinel for a mutate package environment. If you wanted to use that, I think you'd do:
the <- rlang::new_environment()
the$content_cache <- rlang::new_environment()
the$user_cache <- rlang::new_environment()
This idea worked out great IMO @hadley! |
R/board_rsconnect.R
Outdated
rsconnect_content_cache_env <- rlang::new_environment() | ||
rsconnect_user_cache_env <- rlang::new_environment() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a totally reasonable approach but we're starting to build a bit of a consensus around using the
as a sentinel for a mutate package environment. If you wanted to use that, I think you'd do:
the <- rlang::new_environment()
the$content_cache <- rlang::new_environment()
the$user_cache <- rlang::new_environment()
Just a heads up -- AFAICT one side-effect of this change is that if users restart their R sessions, they'll be unable to access cached RSC pin content without an internet connection. The issue is that already accessed content will be in their on-disk cache, but there will be no mapping back to it :/ (it might be worth letting people access pins via guid in the future to work around? see rstudio/pins-python#79) |
@machow That is not different than if we turned the cache off via an environment variable or eventually removed the cache altogether, correct? Those were the other options we have been talking about. I like the idea of using the GUID as an internal bit of metadata. |
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
Addresses #635
Instead of removing these troublesome caches like #660 was headed for, this PR instead changes these caches over to use environments (instead of files on disk). This means that: