From 32bc4320c9482f034dbcce4e339bf269795a504e Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Mon, 27 May 2019 07:29:56 +0200 Subject: [PATCH] gRPC: UML diagrams --- doc/grpc_sequence.plantuml | 57 ++++++++++++++++++++++++++++++++++++++ doc/grpc_server.plantuml | 56 +++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 doc/grpc_sequence.plantuml create mode 100644 doc/grpc_server.plantuml diff --git a/doc/grpc_sequence.plantuml b/doc/grpc_sequence.plantuml new file mode 100644 index 0000000000..410ad9d269 --- /dev/null +++ b/doc/grpc_sequence.plantuml @@ -0,0 +1,57 @@ +@startuml + +actor Client + +box "Server Side" #LightBlue + participant Server order 20 + participant Service order 40 + participant Callback order 30 + participant ServerThread order 10 + +Server -> Service : Create +activate Server +Server -> Callback : Create(Service) +Server -> ServerThread : Launch +activate ServerThread +deactivate Server +Client -> ServerThread: Request #1 +ServerThread -> Server : Queue(Request #1) +Server -> Server : Scheduled +activate Server +Server->ServerThread : Block +deactivate ServerThread +Server -> Server : Take Requests +Server->ServerThread : Unblock +activate ServerThread +Server -> Callback : Init(Request #1) +activate Callback +Server -> Callback : Process(Request #1) +Callback -> Service : Method +activate Service +return Result +deactivate Service +Client -> ServerThread: Request #2 +Callback --> Server : Finish #1 +deactivate Callback +Server --> Client : Reply #1 +deactivate Server +ServerThread -> Server : Queue(Request #2) +Server -> Server : Scheduled +activate Server +Server->ServerThread : Block +deactivate ServerThread +Server->Server : Take Requests +Server->ServerThread : Unblock +activate ServerThread +Server -> Callback : Process(Request #2) +activate Callback +Server -> Callback : Init(Request #1) +Callback -> Service : Method +activate Service +return Result +Callback --> Server : Finish #2 +deactivate Callback +Server --> Client : Reply #2 +deactivate Server +deactivate ServerThread +@enduml diff --git a/doc/grpc_server.plantuml b/doc/grpc_server.plantuml new file mode 100644 index 0000000000..1e428834a5 --- /dev/null +++ b/doc/grpc_server.plantuml @@ -0,0 +1,56 @@ +@startuml + + +package GrpcServices +{ + class RiaGrpcServiceInterface + class RiaGrpcStreamService + { + GetStream(Request*, Reply*, StateHandler*) + RequestGetStream(...) + SetStream(Request*, Reply*, StateHandler*) + RequestSetStream(...) + } + RiaGrpcServiceInterface <|-- RiaGrpcStreamService + +} + +package GrpcCallbacks +{ + class RiaGrpcCallbackInterface + + class RiaGrpcClientStreamCallback + { + + } + + class RiaGrpcServerStreamCallback + { + + } + + RiaGrpcCallbackInterface <|-- RiaGrpcServerStreamCallback + RiaGrpcCallbackInterface <|-- RiaGrpcClientStreamCallback + + + + RiaGrpcServerStreamCallback --> RiaGrpcStreamService::RequestGetStream : registers + RiaGrpcServerStreamCallback --> RiaGrpcStreamService::GetStream : sends N chunks + RiaGrpcClientStreamCallback --> RiaGrpcStreamService::RequestSetStream : registers + RiaGrpcClientStreamCallback --> RiaGrpcStreamService::SetStream : gets N chunks +} + +package GrpcServer +{ + class RiaGrpcServer + RiaGrpcServer "1" *-- "many" RiaGrpcServiceInterface : contains + RiaGrpcServer "1" *-- "many" RiaGrpcCallbackInterface : contains + +} + +package ResInsight { + RiaApplication --> RiaGrpcServer +} + + +@enduml