One option is to include (or wrap) different kinds of messages in a
oneof field of the message used in the streaming rpc.

For example,

service AbcService {
  rpc StreamingCommunication(stream StreamMessage) returns (stream
StreamMessage) {}
}

message StreamMessage {
  oneof message {
    CreateAction create_action = 1
    UpdateAction update_action = 2
    ...
  }
}

On Tue, Oct 26, 2021 at 11:57 PM Eberhard Ludwig <
eberhard.ludwig1...@gmail.com> wrote:

> In case you decide for streaming interface.
> As far as I know, for a streaming interface, you define one message type,
> which you can then send multiple times. But it is not possible to send
> different kind of messages to the peer over one streaming interface.
> If you want to send only one type of message, then the streaming interface
> is good enough.
>
> If you plan to have a real bi-directional message exchange, then it is
> worth to look for another technology.
> I tried finalmq <https://github.com/bexoft/finalmq>, this looks quite
> promising.
>
> Cheers
> Eberhard
>
> Fabiano Ferronato schrieb am Montag, 18. Oktober 2021 um 18:09:45 UTC+2:
>
>> I have a problem to solve: one computer (PC) will send requests to many
>> devices (e.g. RPi). The devices will execute the request and respond.
>>
>> Is it possible to use gRPC ?
>>
>> From the documentation (Introduction) it shows the opposite: clients
>> sending requests to a server. So maybe I'm going the wrong way choosing
>> gRPC.
>>
>> Any help is much appreciated.
>>
>>
>>
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "grpc.io" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/grpc-io/E2d-c4Xusls/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> grpc-io+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/6298a2b5-f2cb-4420-8335-d5bf569eefafn%40googlegroups.com
> <https://groups.google.com/d/msgid/grpc-io/6298a2b5-f2cb-4420-8335-d5bf569eefafn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAA0z_RGJxSYtFQ17Cst1U5eyAXXcOFKd7O1baKX2tLoLd4nLaw%40mail.gmail.com.

Reply via email to