What library are you using? I had no problem doing it with protobuf-net.Grpc. My service looks like this:
member __.SubscribeTupleAsync() =
asyncSeq {
while true do
let time = DateTime.Now
yield string time.Minute, string time.Second
do! Async.Sleep 1000
} |> AsyncSeq.toAsyncEnum
And my client looks like this:
use http = GrpcChannel.ForAddress("http://localhost:10042")
let client = http.CreateGrpcService<ITimeService>()
async {
for (min, sec) in client.SubscribeTupleAsync() |> AsyncSeq.ofAsyncEnum do
printfn "%s, %s" min sec
} |> Async.RunSynchronously
The contract is:
[<ServiceContract>]
type ITimeService =
abstract member SubscribeTupleAsync : unit -> IAsyncEnumerable<string * string>
The .proto file is:
syntax = "proto3";
package ProtobufCommon;
import "google/protobuf/empty.proto";
message Tuple_String_String {
string Item1 = 1;
string Item2 = 2;
}
service TimeService {
rpc SubscribeTuple (.google.protobuf.Empty) returns (stream Tuple_String_String);
}
And the output on the client is:
3, 26
3, 27
3, 28
3, 29
3, 30
3, 31
3, 32
3, 33
3, 34
3, 35
...