MethodError: objects of type ProtoBuf.Codecs.BufferedVector{String} are not callable
┌ Error: grpc_async_stream_response: unexpected exception
│ exception =
│ MethodError: objects of type ProtoBuf.Codecs.BufferedVector{String} are not callable
│ The object of type `ProtoBuf.Codecs.BufferedVector{String}` exists, but no method is defined for this combination of argument types when trying to treat it as a callable object.
└ @ gRPCClient ~/.julia/packages/gRPCClient/U2ltm/src/Streaming.jl:100
when the streaming response would be a struct like
struct Lines
Lines::Vector{String}
error::String
end
proto
message Line { string Line = 1; }
message Lines {
repeated string Lines = 1;
string error = 2;
}
Both types doesn' t work.
when return Line:
┌ Error: grpc_async_stream_response: unexpected exception
│ exception =
│ MethodError: objects of type String are not callable
│ The object of type `String` exists, but no method is defined for this combination of argument types when trying to treat it as a callable object.
└ @ gRPCClient ~/.julia/packages/gRPCClient/U2ltm/src/Streaming.jl:100
Turns out you cannot use same Line as struct name and Line in attributes. Other languages I used (python go) doesn' t have this issue. Changing attribute name works.
message Line { string line = 1; }
message Lines {
repeated string lines = 1;
string error = 2;
}
Interesting. I'm not sure if this is an issue with gRPCClient or ProtoBuf. Maybe there is a scoping issue where if you use the module version of the autogenerated code this conflict will not happen?
@xgdgsc with the above example are you able to use encode on Line when the inner name is also Line? If not, that would be something specific to ProtoBuf.jl.
Closing as I think this is likely an issue with ProtoBuf.jl. All we do is call encode/decode via the public interface.