The idea is to encapsulate just the http server with scripts, and the websocket with ocaps, as a package which can be loaded in base R in order to run code that would otherwise need a standing RCloud server.
It would run only in anonymous mode, with no notebook support. Instead, code will which would be in the notebook is run after the webpage is spawned. (Haven't figured out this part yet - wrap in function? generate script? or is there something more elegant?)
I pushed a working but messy strawman implementation to the rcloud-as-a-package branch.
Needs work:
originally I thought it would build everything to dist/ including dist/htdocs/ but this breaks ordinary usage. Now I think the ordinary build should generate htdocs/ (cleanly separating sources from artifacts for #1728) and there should be another command to build the package.
since $ROOT is the package root, this tries to write to the package's run/ directory, which is wrong and bad. Need to separate writeable directory from $ROOT, or else copy everything to a temp directory.
this copies all of conf/ haha bad
However, it does run. Hope to return to this soon.
This isn't really RCloud, it's really Rserve + rserve.js + basic ocap functionality. If it works we could refactor further, to eliminate the nonworking notebook ocaps.
The idea is to encapsulate just the http server with scripts, and the websocket with ocaps, as a package which can be loaded in base R in order to run code that would otherwise need a standing RCloud server.
It would run only in anonymous mode, with no notebook support. Instead, code will which would be in the notebook is run after the webpage is spawned. (Haven't figured out this part yet - wrap in function? generate script? or is there something more elegant?)
I pushed a working but messy strawman implementation to the
rcloud-as-a-package
branch.Needs work:
dist/
includingdist/htdocs/
but this breaks ordinary usage. Now I think the ordinary build should generatehtdocs/
(cleanly separating sources from artifacts for #1728) and there should be another command to build the package.$ROOT
is the package root, this tries to write to the package'srun/
directory, which is wrong and bad. Need to separate writeable directory from$ROOT
, or else copy everything to a temp directory.conf/
haha badHowever, it does run. Hope to return to this soon.