Git Product home page Git Product logo

Comments (6)

cscheid avatar cscheid commented on August 22, 2024

@s-u, I was hoping to use some kind of environment trickery to make this work "nicely". Is there a way to replace the default environment and then simply replace it with a new one when we switch notebooks? My simple tests with attach and detach didn't do anything useful.

from rcloud.

s-u avatar s-u commented on August 22, 2024

Ah, we don't re-connect between loads? I was assuming each notebook has its own session (that is the Rserve design). This is a bit tricky (because .GlobalEnv is special so just creating a new environment per notebook will break any code that uses .GlobalEnv directly), but solvable -- the question is that we want to do: do we flush the previous state or do we keep all states that have been loaded so far? Obviously, the latter is convenient if you switch between two notebooks, but can use a lot of memory. The former is more "clean" because loading a notebook has always the same effect: clean slate - regardless if it's your first or second try in a session.

from rcloud.

s-u avatar s-u commented on August 22, 2024

BTW: for other reasons (the graphics device and knitr internal state among them) I would actually suggest creating a new socket. In general, due to some memory management features (such as grow-only symbol table), it's typically more efficient to not re-use the same R session for subsequent tasks. Also package management across notebooks will be a pain (unloading packages is not always reliable).

from rcloud.

cscheid avatar cscheid commented on August 22, 2024

The main problem with reloading everything is that the authorization dance is slow and full of redirects.

Is there any chance we can do something on the server side?

from rcloud.

s-u avatar s-u commented on August 22, 2024

Once you have the tokens, you can simply create the socket, no client-side dances anymore (dances required to get the tokens initially). This is all server-side and it only checks against the sessions server or the local database which is fast. You would only need the dance if we let the tokens expire at which point it's probably not bad to get new ones anyway.

from rcloud.

cscheid avatar cscheid commented on August 22, 2024

The only state that's lingering now is loaded packages and graphics state. I'm closing this for now, and we'll handle it better sometime in the future.

from rcloud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.