Skip to content

Commit

Permalink
fix(fileprocessor): did further cleanup and fixed minor error handlin…
Browse files Browse the repository at this point in the history
…g bugs
  • Loading branch information
neilscallywag committed Feb 28, 2024
2 parents d673cb8 + 2f0419c commit 5d24fac
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
34 changes: 34 additions & 0 deletions backend/simple/fileprocessor/src/file_processor_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions backend/simple/fileprocessor/src/file_processor_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

import file_processor_pb2 as file__processor__pb2


class FileProcessorStub(object):
"""Service definition
"""

def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.ProcessFile = channel.unary_unary(
'/fileprocessor.FileProcessor/ProcessFile',
request_serializer=file__processor__pb2.FileUploadRequest.SerializeToString,
response_deserializer=file__processor__pb2.FileProcessResponse.FromString,
)


class FileProcessorServicer(object):
"""Service definition
"""

def ProcessFile(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_FileProcessorServicer_to_server(servicer, server):
rpc_method_handlers = {
'ProcessFile': grpc.unary_unary_rpc_method_handler(
servicer.ProcessFile,
request_deserializer=file__processor__pb2.FileUploadRequest.FromString,
response_serializer=file__processor__pb2.FileProcessResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'fileprocessor.FileProcessor', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class FileProcessor(object):
"""Service definition
"""

@staticmethod
def ProcessFile(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, '/fileprocessor.FileProcessor/ProcessFile',
file__processor__pb2.FileUploadRequest.SerializeToString,
file__processor__pb2.FileProcessResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

0 comments on commit 5d24fac

Please sign in to comment.