Coder Social home page Coder Social logo

Locking... about ergo HOT 10 CLOSED

ergo-services avatar ergo-services commented on May 14, 2024
Locking...

from ergo.

Comments (10)

halturin avatar halturin commented on May 14, 2024

Hi, sorry for delay with answer.

I'm happy to hear that this project is useful and can be a painkiller for you :). I will try to look it deeper a bit later, but you are welcome to make PR

from ergo.

ast avatar ast commented on May 14, 2024

Hi, no problem!

I will look into it and see if I can put together a pull request! So far it's working really great. Probably the best way to integrate golang libraries with erlang.

Maybe now with the introduction of go modules it can also be built as part of a rebar3 application.

from ergo.

ciyrus avatar ciyrus commented on May 14, 2024

Hi a small question.

how to convert the int parameters in gen server call
sample call
gen_server:call({examplegs,'test@localhost'}, {getZrange,{num_list_11111111,2}}).

i can get getZrange and num_list_11111111 but {2...) gives error

if i change 2 in to a string then its working
gen_server:call({examplegs,'test@localhost'}, {getZrange,{num_list_11111111,'2'}}).

Call recovered: &runtime.TypeAssertionError{_interface:(*runtime._type)(0x8be3a0), concrete:(*runtime._type)(0x88f380), asserted:(*runtime._type)(0x88e880), missingMethod:""}

please help me on this

from ergo.

halturin avatar halturin commented on May 14, 2024

@ciyrus could you please show me your implementation of genserver

from ergo.

ciyrus avatar ciyrus commented on May 14, 2024

@halturin

Thank You for the reply
Im new to both Go and Erlang. so pls ignore if any mistakes are there

just executing below in Erlang shell
gen_server:call({examplegs,'test@localhost'}, {getZrange}).

in go implementation i'm getting the parameters like below
c := req[0].(etf.Atom)
println(c)

input 1
gen_server:call({examplegs,'test@localhost'}, {getZrange}).

output 1 in go

getZrange

input 2 (changed getZrange to an integer)
gen_server:call({examplegs,'test@localhost'}, {100}).

output 2 in go
Call recovered: &runtime.TypeAssertionError{_interface:(*runtime._type)(0x8be3a0), concrete:(*runtime._type)(0x88f380), asserted:(*runtime._type)(0x88e880), missingMethod:""}

from ergo.

halturin avatar halturin commented on May 14, 2024

The reason of this behavior due to this line

c := req[0].(etf.Atom)

It's expected an atom, not an integer.

from ergo.

ciyrus avatar ciyrus commented on May 14, 2024

Can u please guide how to convert it to integer.
Because I tried following and got the same error
strconv.Atoi
strconv.ParseInt

from ergo.

halturin avatar halturin commented on May 14, 2024

Please, have a look this example

https://github.com/halturin/ergonode/blob/master/examples/gonode.go

Especially line 48.

from ergo.

ciyrus avatar ciyrus commented on May 14, 2024

@halturin

Thanks a lot. found it. need to check the type first... that's what i missed

Once again Thanks a lot

from ergo.

halturin avatar halturin commented on May 14, 2024

i've just merged a bunch of updates, so its not valid anymore

from ergo.

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.