Coder Social home page Coder Social logo

Comments (3)

phgrosjean avatar phgrosjean commented on June 15, 2024

Very late answer, ... but I am afraid I don't understand what you want here. You should understand that the svSocket socket server is sharing .GlobalEnv between the different clients. This is a feature, on the contrary to, say Rserve, that creates a different workspace for each client. With svSocket, you really work together in the same session. But then, you should be very careful when you want to do complex things, because results may be very strange.

One scenario where this is useful, is when a client is just inspecting/monitoring an R session, but does not change anything there. It seems to be the case with your toy example, although your example really does nothing useful. So, my confusion!

from svsocket.

yogesh-bansal avatar yogesh-bansal commented on June 15, 2024

What I wanted was basically to have an option in evalServer function so that instead for waiting for results, we just send the command to the server and return to the client session immediately, instead of having the client session busy until the command is processed on server side. It was useful in a special case in which I didn't want the results back in client session, while the client session was only used to trigger an API call on the server-side which handles some IoT stuff.

Though I was able to have it by writing a copy of the evalServer function and just by cutting the code at line 128 in https://github.com/SciViews/svSocket/blob/master/R/evalServer.R

from svsocket.

phgrosjean avatar phgrosjean commented on June 15, 2024

Ah OK, now I understand. Have you read the man page for ?processSocket, especially this paragraph:

"The sequence <<>> at the beginning of a command indicates that the server wants to disconnect once the command is fully treated by R. Similarly, the sequence <<>> tells the server to disconnect the client before processing the command (no error message is returned to the client!)."

I think this is what you are looking for. So, prepend you command with <<<Q>>> and you will be disconnected as soon as your command is received and before the server processes it.

from svsocket.

Related Issues (6)

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.