The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#) https://grpc.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

46 lines
1.3 KiB

# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import prime_pb2 as prime__pb2
class PrimeCheckerStub(object):
"""Service to check primality.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.check = channel.unary_unary(
'/prime.PrimeChecker/check',
request_serializer=prime__pb2.PrimeCandidate.SerializeToString,
response_deserializer=prime__pb2.Primality.FromString,
)
class PrimeCheckerServicer(object):
"""Service to check primality.
"""
def check(self, request, context):
"""Determines the primality of an integer.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_PrimeCheckerServicer_to_server(servicer, server):
rpc_method_handlers = {
'check': grpc.unary_unary_rpc_method_handler(
servicer.check,
request_deserializer=prime__pb2.PrimeCandidate.FromString,
response_serializer=prime__pb2.Primality.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'prime.PrimeChecker', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))