Cross-cutting Concepts

RPC over Web Socket

Since the raml2agl implements an RPC over a Web Socket, Fig. 16 shows a generic RPC and Fig. 17 shows a generic Web Socket communication. Note that in order to communicate over Web Socket a connection between Client and Server has to be acknowledged. Similarly, the connection has to be closed once it’s not going to be used anymore. This part is handled in the WebSocketApi constructor and destructor, respectively. Moreover, the APP Class and the AGL Service handle the messaging and thus simulating an RPC.

@startuml

  activate Client
  Client -> Server : request
  deactivate Client
  activate Server

  Server -> Client : reply
  deactivate Server
  activate Client

@enduml

Fig. 16 RPC Model

@startuml

  activate Client
  activate Server
  Client -> Server : Handshake
  Server -> Client

  Client <-> Server : Message Exchange

  alt
  Client -> Server : Close Connection
  else
  Server -> Client : Close Connection
  end

@enduml

Fig. 17 Web Socket Model