Stop using a grpc stream.

This commit is contained in:
Piv
2019-11-28 08:01:26 +10:30
parent eae291da07
commit 10e45f5b45
4 changed files with 14 additions and 18 deletions

View File

@@ -14,12 +14,12 @@ class CarControlStub(object):
Args:
channel: A grpc.Channel.
"""
self.SetThrottle = channel.stream_unary(
self.SetThrottle = channel.unary_unary(
'/MotorControl.CarControl/SetThrottle',
request_serializer=motorService__pb2.ThrottleRequest.SerializeToString,
response_deserializer=motorService__pb2.ThrottleResponse.FromString,
)
self.SetSteering = channel.stream_unary(
self.SetSteering = channel.unary_unary(
'/MotorControl.CarControl/SetSteering',
request_serializer=motorService__pb2.SteeringRequest.SerializeToString,
response_deserializer=motorService__pb2.SteeringResponse.FromString,
@@ -30,14 +30,14 @@ class CarControlServicer(object):
# missing associated documentation comment in .proto file
pass
def SetThrottle(self, request_iterator, context):
def SetThrottle(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SetSteering(self, request_iterator, context):
def SetSteering(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
@@ -47,12 +47,12 @@ class CarControlServicer(object):
def add_CarControlServicer_to_server(servicer, server):
rpc_method_handlers = {
'SetThrottle': grpc.stream_unary_rpc_method_handler(
'SetThrottle': grpc.unary_unary_rpc_method_handler(
servicer.SetThrottle,
request_deserializer=motorService__pb2.ThrottleRequest.FromString,
response_serializer=motorService__pb2.ThrottleResponse.SerializeToString,
),
'SetSteering': grpc.stream_unary_rpc_method_handler(
'SetSteering': grpc.unary_unary_rpc_method_handler(
servicer.SetSteering,
request_deserializer=motorService__pb2.SteeringRequest.FromString,
response_serializer=motorService__pb2.SteeringResponse.SerializeToString,