I quite like the simplicity of using scheduled RMarkdown documents in RStudio Connect to create simple ETL flows for subsequent document renders or even shiny apps. @kellobri describes this process here, and suggests using
reactiveFileReaderto allow shiny apps to detect changes in a data product and act accordingly.
I would like to know if there is a similar or analogous workflow for
plumberAPIs? I would like my
plumberAPI to be able to detect changes in a source data set using the above ETL method, and reload the data over HTTP.
I can do this naively by loading the data every time my
plumberAPI is called, but this is no good when the data are large. I think the solution would be to put the code that loads the data outside of the API endpoint functions in my plumber.R file, but then how would I get
plumberto restart when the data changes?