166 lines
6.4 KiB
Python
166 lines
6.4 KiB
Python
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
"""Client and server classes corresponding to protobuf-defined services."""
|
|
import grpc
|
|
|
|
import queue_pb2 as queue__pb2
|
|
|
|
|
|
class QueueStub(object):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
|
|
def __init__(self, channel):
|
|
"""Constructor.
|
|
|
|
Args:
|
|
channel: A grpc.Channel.
|
|
"""
|
|
self.Push = channel.unary_unary(
|
|
'/queue.Queue/Push',
|
|
request_serializer=queue__pb2.PushRequest.SerializeToString,
|
|
response_deserializer=queue__pb2.PushResponse.FromString,
|
|
)
|
|
self.PushMany = channel.stream_unary(
|
|
'/queue.Queue/PushMany',
|
|
request_serializer=queue__pb2.PushRequest.SerializeToString,
|
|
response_deserializer=queue__pb2.PushResponse.FromString,
|
|
)
|
|
self.Pop = channel.unary_unary(
|
|
'/queue.Queue/Pop',
|
|
request_serializer=queue__pb2.PopRequest.SerializeToString,
|
|
response_deserializer=queue__pb2.PopResponse.FromString,
|
|
)
|
|
self.Drain = channel.unary_stream(
|
|
'/queue.Queue/Drain',
|
|
request_serializer=queue__pb2.DrainRequest.SerializeToString,
|
|
response_deserializer=queue__pb2.PopResponse.FromString,
|
|
)
|
|
|
|
|
|
class QueueServicer(object):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
|
|
def Push(self, request, context):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
context.set_details('Method not implemented!')
|
|
raise NotImplementedError('Method not implemented!')
|
|
|
|
def PushMany(self, request_iterator, context):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
context.set_details('Method not implemented!')
|
|
raise NotImplementedError('Method not implemented!')
|
|
|
|
def Pop(self, request, context):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
context.set_details('Method not implemented!')
|
|
raise NotImplementedError('Method not implemented!')
|
|
|
|
def Drain(self, request, context):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
context.set_details('Method not implemented!')
|
|
raise NotImplementedError('Method not implemented!')
|
|
|
|
|
|
def add_QueueServicer_to_server(servicer, server):
|
|
rpc_method_handlers = {
|
|
'Push': grpc.unary_unary_rpc_method_handler(
|
|
servicer.Push,
|
|
request_deserializer=queue__pb2.PushRequest.FromString,
|
|
response_serializer=queue__pb2.PushResponse.SerializeToString,
|
|
),
|
|
'PushMany': grpc.stream_unary_rpc_method_handler(
|
|
servicer.PushMany,
|
|
request_deserializer=queue__pb2.PushRequest.FromString,
|
|
response_serializer=queue__pb2.PushResponse.SerializeToString,
|
|
),
|
|
'Pop': grpc.unary_unary_rpc_method_handler(
|
|
servicer.Pop,
|
|
request_deserializer=queue__pb2.PopRequest.FromString,
|
|
response_serializer=queue__pb2.PopResponse.SerializeToString,
|
|
),
|
|
'Drain': grpc.unary_stream_rpc_method_handler(
|
|
servicer.Drain,
|
|
request_deserializer=queue__pb2.DrainRequest.FromString,
|
|
response_serializer=queue__pb2.PopResponse.SerializeToString,
|
|
),
|
|
}
|
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
'queue.Queue', rpc_method_handlers)
|
|
server.add_generic_rpc_handlers((generic_handler,))
|
|
|
|
|
|
# This class is part of an EXPERIMENTAL API.
|
|
class Queue(object):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
|
|
@staticmethod
|
|
def Push(request,
|
|
target,
|
|
options=(),
|
|
channel_credentials=None,
|
|
call_credentials=None,
|
|
insecure=False,
|
|
compression=None,
|
|
wait_for_ready=None,
|
|
timeout=None,
|
|
metadata=None):
|
|
return grpc.experimental.unary_unary(request, target, '/queue.Queue/Push',
|
|
queue__pb2.PushRequest.SerializeToString,
|
|
queue__pb2.PushResponse.FromString,
|
|
options, channel_credentials,
|
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
|
|
@staticmethod
|
|
def PushMany(request_iterator,
|
|
target,
|
|
options=(),
|
|
channel_credentials=None,
|
|
call_credentials=None,
|
|
insecure=False,
|
|
compression=None,
|
|
wait_for_ready=None,
|
|
timeout=None,
|
|
metadata=None):
|
|
return grpc.experimental.stream_unary(request_iterator, target, '/queue.Queue/PushMany',
|
|
queue__pb2.PushRequest.SerializeToString,
|
|
queue__pb2.PushResponse.FromString,
|
|
options, channel_credentials,
|
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
|
|
@staticmethod
|
|
def Pop(request,
|
|
target,
|
|
options=(),
|
|
channel_credentials=None,
|
|
call_credentials=None,
|
|
insecure=False,
|
|
compression=None,
|
|
wait_for_ready=None,
|
|
timeout=None,
|
|
metadata=None):
|
|
return grpc.experimental.unary_unary(request, target, '/queue.Queue/Pop',
|
|
queue__pb2.PopRequest.SerializeToString,
|
|
queue__pb2.PopResponse.FromString,
|
|
options, channel_credentials,
|
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
|
|
@staticmethod
|
|
def Drain(request,
|
|
target,
|
|
options=(),
|
|
channel_credentials=None,
|
|
call_credentials=None,
|
|
insecure=False,
|
|
compression=None,
|
|
wait_for_ready=None,
|
|
timeout=None,
|
|
metadata=None):
|
|
return grpc.experimental.unary_stream(request, target, '/queue.Queue/Drain',
|
|
queue__pb2.DrainRequest.SerializeToString,
|
|
queue__pb2.PopResponse.FromString,
|
|
options, channel_credentials,
|
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|