Provide utility function for gRPC communication forwarding
To easily build proxy servers that serve features implemented by other servers, it would be great to be able to do something like this:
class Server(...):
def __init__(...):
...
# feature implemented by this server directly
self.set_feature_implementation(...)
# connect to other server, forward some of its features
client1 = OtherSilaClient(...) # connect to other server
self.forward_client_feature(client1.SomeFeature)
This would add that feature to the implemented features of the server, but its actual implementation just forwards all communication to/from the connected other server.
Ideally there would be two options:
- forward all gRPC traffic directly (after applying metadata interceptors of this server)
- handling incoming and outgoing traffic like normally done by clients and servers using this framework (parameter validation, error conversion, ...)
(requested by @markdoerr @StefanMa, contributions are welcome)