-
Notifications
You must be signed in to change notification settings - Fork 27
Description
We currently use protobuf to define service interfaces and types. The protobuf compiler generates code that does not know anything about iceoryx2's ZeroCopySend trait and it seems impossible to simply implement the trait on the generated types, because they heavily rely on types that are not ZeroCopySend like std::string::String.
The current UTransport API relies on the UMessage type which contains a byte array as the payload. The byte array is expected to contain a well-defined serialization of the data, e.g. UTF-8 encoded JSON or a protobuf, indicated by the payload format header field. While this allows for a lot of flexibility in supported data types, it does not fit the intended zero-copy approach very well.
In an attempt to simply optimize for intra-node communication, we might want to add variants of the L2-APIs that are generic over a payload type that is ZeroCopySend.
This would, however, raise some questions when it comes to user-experience and cross-language interoperability:
-
How does this fit with using protobuf as the IDL for defining service interfaces? Can we provide a blanket implementation for
ZeroCopySendforprotobuf::Message? Or do we need to build our own code generators? -
If so, would it make sense to use an IDL like Franca that is already being used in the automotive domain for such use cases? However, building and maintaining our own code generators will be quite an effort, if we intend to support anything beyond Rust only.
-
If we use
ZeroCopySendtypes for intra-node communication, what would be the data serialization format for inter-node communication? Can we simply map theZeroCopySendtypes into a byte array and send it over whatever transport we want to use, similar to what we already do today in a UTransport?