FAQ
Hi,

I have written a go function which will receive a string as an input and
return an array of strings as an output.

Due to the lack of a native GUI toolkit by go, I am planning to make this
go function as a service and call this service from a javascript / gtk
client (not decided yet).

Now the service could return the array of strings in either JSON or
protocol buffers. Speed is of most importance to me as my application will
send a lot of queries to the server and will want instantaneous response.
(Think of it like an auto-completion service for an editor).

I cannot use gob as iiuc it cannot be decoded by either javascript or GTK.

So what encoding should I use ? Is there any other form of encoding that I
should use ? I saw that there is a web rpc package. But in all the
tutorials that I have seen the server and client both are in go and so I am
not sure if the webrpc can be called from javascript / gtk.

Any help will be appreciated.

Sankar

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Egon at Mar 2, 2014 at 9:39 am
    I think protobuf is the best option for that. Basically the swap from one
    to the other (json <-> protobuf) is quite trivial then just try it out and
    see which one works best (of course when you get the results then post them
    in the forum as well).

    Also, you can never get instantaneous so figure out the minimum that is
    still acceptable. It's dealing with user input in an editor then 30ms
    round-trip would be quite acceptable. This also means you need to figure
    out how far the service is from the location you are using it...

    If you want fast response times then probably you need to have a open
    connection because the handshake of a secure connection can be quite slow.

    + egon
    On Saturday, March 1, 2014 5:16:47 PM UTC+2, Sankar wrote:

    Hi,

    I have written a go function which will receive a string as an input and
    return an array of strings as an output.

    Due to the lack of a native GUI toolkit by go, I am planning to make this
    go function as a service and call this service from a javascript / gtk
    client (not decided yet).

    Now the service could return the array of strings in either JSON or
    protocol buffers. Speed is of most importance to me as my application will
    send a lot of queries to the server and will want instantaneous response.
    (Think of it like an auto-completion service for an editor).

    I cannot use gob as iiuc it cannot be decoded by either javascript or GTK.

    So what encoding should I use ? Is there any other form of encoding that I
    should use ? I saw that there is a web rpc package. But in all the
    tutorials that I have seen the server and client both are in go and so I am
    not sure if the webrpc can be called from javascript / gtk.

    Any help will be appreciated.

    Sankar
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Mmendez534 at Mar 2, 2014 at 7:11 pm
    I would also take a look at cap'n proto. It should cut down on some
    encoding/decoding time.
    On Saturday, March 1, 2014 10:16:47 AM UTC-5, Sankar wrote:

    Hi,

    I have written a go function which will receive a string as an input and
    return an array of strings as an output.

    Due to the lack of a native GUI toolkit by go, I am planning to make this
    go function as a service and call this service from a javascript / gtk
    client (not decided yet).

    Now the service could return the array of strings in either JSON or
    protocol buffers. Speed is of most importance to me as my application will
    send a lot of queries to the server and will want instantaneous response.
    (Think of it like an auto-completion service for an editor).

    I cannot use gob as iiuc it cannot be decoded by either javascript or GTK.

    So what encoding should I use ? Is there any other form of encoding that I
    should use ? I saw that there is a web rpc package. But in all the
    tutorials that I have seen the server and client both are in go and so I am
    not sure if the webrpc can be called from javascript / gtk.

    Any help will be appreciated.

    Sankar
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 1, '14 at 3:16p
activeMar 2, '14 at 7:11p
posts3
users3
websitegolang.org

3 users in discussion

Sankar: 1 post Egon: 1 post Mmendez534: 1 post

People

Translate

site design / logo © 2022 Grokbase