Private
Public Access
1
0

not working

This commit is contained in:
Sander Roosendaal
2019-12-19 12:44:07 +01:00
parent 724720aa39
commit 921e58eef7
5 changed files with 292 additions and 19 deletions

View File

@@ -0,0 +1,46 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import rowers.otw_power_calculator_pb2 as otw__power__calculator__pb2
class PowerStub(object):
"""Power service definition
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.CalcPower = channel.unary_unary(
'/otw_power_calculator.Power/CalcPower',
request_serializer=otw__power__calculator__pb2.WorkoutPowerRequest.SerializeToString,
response_deserializer=otw__power__calculator__pb2.CalculationResult.FromString,
)
class PowerServicer(object):
"""Power service definition
"""
def CalcPower(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 add_PowerServicer_to_server(servicer, server):
rpc_method_handlers = {
'CalcPower': grpc.unary_unary_rpc_method_handler(
servicer.CalcPower,
request_deserializer=otw__power__calculator__pb2.WorkoutPowerRequest.FromString,
response_serializer=otw__power__calculator__pb2.CalculationResult.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'otw_power_calculator.Power', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))