That's not something that protobuf targets. If you have a syntax that
allows you to convey an expression as a string or similar, then by all
means do that - but protobuf will just see it as an opaque string. Note
that there are usually a range of concerns when transferring executable
code (of any kind) - less of a concern for server-to-client, but not
removed. Think "XSS", for a trivial example.

On 30 May 2017 7:18 p.m., "Alex TS" <alexandre.thsi...@gmail.com> wrote:

Hey everyone,
I'm quite new to Protocol Buffers and don't really have a background on the
theme, so pardon me if this sounds absurd or if this is not the right forum.

With that out of the way, if I'd like to transfer say, a method, from the
server to execute on the client. Is that possible at all using the `bytes`
type or something similar?

The issue being that in an ideal world I'd like to run a method on the
server with the arguments provided by the client and get it back resolved
for injection.

As a silly example, something like this, in JS:

*ServiceX*
const privateMethod = (x) => x * x
const publicMethod = (elementId, y) => document.getElementById(elementId).
innerHTML(privateMethod(y))


*ClientY*
server.publicMethod("root", 3)


Is it possible to transfer the `publicMethod` itself from the server for a
later execution triggered by the client and having the side effects also on
the client? My idea here being basically to be able to create an
application in one service in an isolated way and inject it on another
service that doesn't have to know any details of its implementation details.

Thanks for your help!

-- 
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to