GithubHelp home page GithubHelp logo

get a variable value about spark-server HOT 7 CLOSED

brewskey avatar brewskey commented on July 17, 2024
get a variable value

from spark-server.

Comments (7)

AntonPuko avatar AntonPuko commented on July 17, 2024 1

Thanks, @durielz. with return newBuffer.toString(); - fromBinary() returns stringified bufferReader object, instead of actual string from buffer ^.^, so you see '[object object]'. In the old code, there were like you do: return buffer.toString();...so nice catch.
will be fixed in that PR: Brewskey/spark-protocol#14

from spark-server.

AntonPuko avatar AntonPuko commented on July 17, 2024

Hi, could you see in debugger or console.log what [object Object] actually is? I can't reproduce. I get { result: varValue } at least for INT.

from spark-server.

durielz avatar durielz commented on July 17, 2024

if i console.log the varValue i get [object Object] again. With the old spark-server i get:
{ "cmd": "VarReturn", "name": "config", "result": "{ \"t_threshold\": \"24\", \"flow_threshold\": \"50\" }", "coreInfo": { "connected": true } }

from spark-server.

durielz avatar durielz commented on July 17, 2024

Your code seems to work in the same way as the old one, so i don't understand why but if i change the line 318 in lib/Messages.js in protocol
return newBuffer.toString();
to
return buffer.toString();
so without process data with BufferReader, it works.

hope it can help you

from spark-server.

wdimmit avatar wdimmit commented on July 17, 2024

Using spark-protocol (commit ecd803d), I'm still seeing the { "result": "[object Object]" } whenever I try to pull a string result from a variable. Int values come through normally.

from spark-server.

AntonPuko avatar AntonPuko commented on July 17, 2024

hm. just checked. works ok with strings for me.
could you check. what do you have as bufferReader.buffer, when do calls, here:
https://github.com/Brewskey/spark-protocol/blob/master/src/lib/Messages.js#L312

from spark-server.

wdimmit avatar wdimmit commented on July 17, 2024

Line 312 is: return bufferReader.buffer.toString();

from spark-server.

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.