conbench / conbenchcoms

Communicate with the conbench API in R
Other
0 stars 0 forks source link

Re-use responses #5

Closed boshek closed 1 year ago

boshek commented 1 year ago

When working interactively, it would make it much easier if we re-used response for some length of time (set by an environmental variable?). This has two advantages. First:

This should persist across sessions. Using memoise and specifically cache_filesystem seems like a good idea.

boshek commented 1 year ago

@alistaire47 can you think of any downside to using memoise here and build it into conbenchcoms?

alistaire47 commented 1 year ago

For CI I think it's great. For local work you may want to clear it every day or whatever so you don't accidentally get too-stale data.

sayantikabanik commented 1 year ago

@boshek to have bit more clarity, it does feels memoise might add another layer of action every-time we perform local development.

Should we continue with the env variable solution + manually triggering the update of .rds file? Happy to have another round of brainstorming

boshek commented 1 year ago

Thinking on this more, I think that this is not in scope for conbenchcoms. This package should provide a clean pathway to get data without intermediate caching steps where we have to maintain the state. I think that part should be left up to the user. A user can readily make use of something like memoise and wrap a conbenchcoms function. Or if using quarto/rmarkdown, a user can cache at that level. Having it in here doesn't provide a clear enough benefit IMO to justify the complexity it would introduce.