|
|
@ -227,21 +227,17 @@ async def _handle_rpc(list generic_handlers, RPCState rpc_state, object loop): |
|
|
|
# TODO(lidiz) return unimplemented error to client side |
|
|
|
# TODO(lidiz) return unimplemented error to client side |
|
|
|
raise NotImplementedError() |
|
|
|
raise NotImplementedError() |
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
|
# TODO(lidiz) extend to all 4 types of RPC |
|
|
|
# TODO(lidiz) extend to all 4 types of RPC |
|
|
|
if not method_handler.request_streaming and method_handler.response_streaming: |
|
|
|
if not method_handler.request_streaming and method_handler.response_streaming: |
|
|
|
await _handle_unary_stream_rpc(method_handler, |
|
|
|
await _handle_unary_stream_rpc(method_handler, |
|
|
|
rpc_state, |
|
|
|
rpc_state, |
|
|
|
loop) |
|
|
|
loop) |
|
|
|
elif not method_handler.request_streaming and not method_handler.response_streaming: |
|
|
|
elif not method_handler.request_streaming and not method_handler.response_streaming: |
|
|
|
await _handle_unary_unary_rpc(method_handler, |
|
|
|
await _handle_unary_unary_rpc(method_handler, |
|
|
|
rpc_state, |
|
|
|
rpc_state, |
|
|
|
loop) |
|
|
|
loop) |
|
|
|
else: |
|
|
|
else: |
|
|
|
raise NotImplementedError() |
|
|
|
raise NotImplementedError() |
|
|
|
|
|
|
|
except Exception as e: |
|
|
|
|
|
|
|
_LOGGER.exception(e) |
|
|
|
|
|
|
|
raise |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _RequestCallError(Exception): pass |
|
|
|
class _RequestCallError(Exception): pass |
|
|
@ -473,7 +469,7 @@ cdef class AioServer: |
|
|
|
If the Cython representation is deallocated without underlying objects |
|
|
|
If the Cython representation is deallocated without underlying objects |
|
|
|
freed, raise an RuntimeError. |
|
|
|
freed, raise an RuntimeError. |
|
|
|
""" |
|
|
|
""" |
|
|
|
# NOTE(lidiz) if users create server, and then dealloc it immediately. |
|
|
|
# TODO(lidiz) if users create server, and then dealloc it immediately. |
|
|
|
# There is a potential memory leak of created Core server. |
|
|
|
# There is a potential memory leak of created Core server. |
|
|
|
if self._status != AIO_SERVER_STATUS_STOPPED: |
|
|
|
if self._status != AIO_SERVER_STATUS_STOPPED: |
|
|
|
_LOGGER.warn( |
|
|
|
_LOGGER.warn( |
|
|
|