gRPC: UML diagrams

This commit is contained in:
Gaute Lindkvist 2019-05-27 07:29:56 +02:00
parent 14ff796392
commit 32bc4320c9
2 changed files with 113 additions and 0 deletions

View File

@ -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

56
doc/grpc_server.plantuml Normal file
View File

@ -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<RiaGrpcStreamService, Request, Reply, StateHandler>
{
}
class RiaGrpcServerStreamCallback<RiaGrpcStreamService, Request, Reply, StateHandler>
{
}
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