{"action":"created","issue":{"url":"https://api.github.com/repos/s-u/Rserve/issues/42","labels_url":"https://api.github.com/repos/s-u/Rserve/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/s-u/Rserve/issues/42/comments","events_url":"https://api.github.com/repos/s-u/Rserve/issues/42/events","html_url":"https://github.com/s-u/Rserve/issues/42","id":111874654,"number":42,"title":"Is it possible to share loaded packages accross Rserve sessions ?","user":{"login":"fviale","id":3063713,"avatar_url":"https://avatars.githubusercontent.com/u/3063713?v=3","gravatar_id":"","url":"https://api.github.com/users/fviale","html_url":"https://github.com/fviale","followers_url":"https://api.github.com/users/fviale/followers","following_url":"https://api.github.com/users/fviale/following{/other_user}","gists_url":"https://api.github.com/users/fviale/gists{/gist_id}","starred_url":"https://api.github.com/users/fviale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fviale/subscriptions","organizations_url":"https://api.github.com/users/fviale/orgs","repos_url":"https://api.github.com/users/fviale/repos","events_url":"https://api.github.com/users/fviale/events{/privacy}","received_events_url":"https://api.github.com/users/fviale/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-16T17:23:25Z","updated_at":"2015-10-22T14:21:40Z","closed_at":null,"body":"I'm new to RServe which I use on linux via a Java API. It's RServe 1.8.1\r\n\r\nI noticed that across different sessions, needed R packages are each time reloaded (which takes time).\r\n\r\nI wonder if there are various possibilities to load packages once for all and share them across all sessions.\r\n\r\nSome guesses : \r\n1) As I start RServe from R, I could maybe load libaries before calling run.Rserve, but that would not be a good solution as in my application, I don't know before starting the server which packages will be needed\r\n2) I noticed the function self.ctrlEval, could it be called from a session to load on the server some packages which will be then accessible to subsequent sessions ?"},"comment":{"url":"https://api.github.com/repos/s-u/Rserve/issues/comments/150239343","html_url":"https://github.com/s-u/Rserve/issues/42#issuecomment-150239343","issue_url":"https://api.github.com/repos/s-u/Rserve/issues/42","id":150239343,"user":{"login":"fviale","id":3063713,"avatar_url":"https://avatars.githubusercontent.com/u/3063713?v=3","gravatar_id":"","url":"https://api.github.com/users/fviale","html_url":"https://github.com/fviale","followers_url":"https://api.github.com/users/fviale/followers","following_url":"https://api.github.com/users/fviale/following{/other_user}","gists_url":"https://api.github.com/users/fviale/gists{/gist_id}","starred_url":"https://api.github.com/users/fviale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fviale/subscriptions","organizations_url":"https://api.github.com/users/fviale/orgs","repos_url":"https://api.github.com/users/fviale/repos","events_url":"https://api.github.com/users/fviale/events{/privacy}","received_events_url":"https://api.github.com/users/fviale/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T14:21:40Z","updated_at":"2015-10-22T14:21:40Z","body":"Maybe it's better if I explain a bit more what I'm trying to achieve, and the background. Basically, what I'm trying to do is a JSR 223 Scripting Engine with a RServe backend. We integrate this script engine in our distributed workflow scheduler to allow the execution of R tasks, among other script engines available. \r\n\r\nPreviously, we developped a R JSR223 Script engine based on JRI. It was sufficient in most scenarios, but we faced an issue regarding multiple instances of JRI engines running on the same machine and each loading large amount of data. The big data was duplicated as many time as there were concurent JRI engines.\r\n\r\nRServe can theoretically solve this issue, as the big data can be stored and updated on the server side, while user sessions simply consume this data without replicating it. That's why we started to work on a RServe integration.\r\n\r\nI made a diagram describing the general use case and the two options I have to send control commands\r\n\r\n![rserve ctrl](https://cloud.githubusercontent.com/assets/3063713/10666573/b63a3ec6-78d2-11e5-9194-6a21c813bbb7.png)\r\n\r\nSo basically, what you are saying is that the self.CtrlEval() possibility will not work and I have to rely on the serverEval() java call ?\r\n\r\nRegarding the call to Rserve(), I was using it for testing indeed, to be able to view what's happening on the server. When I run the Rserve() command, RStudio seems able to attach automagically to the spawned RServe session (running in a different process). And when I submit expressions from my JSR223 engine, I see them appearing on the RStudio-RServe session (practical for debugging). Now of course, I don't know precisely what's happening in the backend.\r\n\r\n"}}