The Correct Approach: Return the Updated Value

The standard and correct way to handle this is to embrace the client-server
nature of gRPC. The plugin (exec2) should perform its logic and then *return
the modified data* back to the main application (exec1).

The workflow should be:

   1.

   *exec1 (Client):* Calls a gRPC function on exec2, passing the current
   state of the item in the request.
   2.

   *exec2 (Server):* Receives the item (as a copy), performs its updates on
   that copy.
   3.

   *exec2 (Server):* Returns the fully updated item in the gRPC response.
   4.

   *exec1 (Client):* Receives the response and updates its original item
   with the returned data.



Sharon Mafgaoker – Senior Solutions Architect

M. 050 995 99 16 | sha...@cloud5.co.il




On Sat, 26 Jul 2025 at 4:06 Robert Engels <reng...@ix.netcom.com> wrote:

> You can’t typically do this from user code. You should used shared memory
> or a memory mapped file, or socket communication.
>
> On Jul 25, 2025, at 7:20 PM, Léa Galet <leaesperee.ga...@gmail.com> wrote:
>
> 
> Hi,
> I have 2 executables in go (called exec1 and exec 2)
> exec1 is the main application, loading exec2 as a grpc plugin
> Exec 1 is the one making the calls to exec 2, so there's a possibility of
> downward communication
> i wanted my exec2 to be able to update some values of an item passed from
> exec1 so i gave the item as a pointer (wanted to use the inline update
> property of pointers)
> unfortunatly, in exec2 it's a copy of the pointer and not the pointer
> directly (i printed the pointer adresses to be sure)
> i don't seem to find a definitive answer anywhere so
> Is there a method to have exec2 use the same pointer as exec1?
>
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/golang-nuts/d7d3b535-e670-48e8-af1e-366dfb1d0b56n%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/d7d3b535-e670-48e8-af1e-366dfb1d0b56n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/golang-nuts/600BA26A-8FEA-42E6-80D8-96A082B0BB9C%40ix.netcom.com
> <https://groups.google.com/d/msgid/golang-nuts/600BA26A-8FEA-42E6-80D8-96A082B0BB9C%40ix.netcom.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2BKEDerwAeunKX9h0PfEiNw5ShHqDpomLhWsJbfHkTKKzP1F3w%40mail.gmail.com.

Reply via email to