Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

gRPC Sequence Diagrams

Connection Establishment

sequenceDiagram
    participant C as Client
    participant S as Server
    C->>S: Connect to :50051
    S-->>C: Connection established
    C->>S: GetChassis()
    S-->>C: Chassis data
    Note over C,S: Connection ready for streaming

Bidirectional Streaming Flow

sequenceDiagram
    participant C as Client
    participant S as Server
    C->>S: Open SendCommand stream
    S-->>C: Stream ready
    C->>S: SendCommandRequest (Connect)
    S-->>C: CommandResponse (Success)
    C->>S: SendCommandRequest (GetTasks)
    S-->>C: CommandResponse (TaskCollection)
    C->>S: SendCommandRequest (Heartbeat)
    S-->>C: CommandResponse (Heartbeat)
    Note over C,S: Stream remains open
    C->>S: Close stream
    S-->>C: Stream closed

Command Processing

flowchart TD
    A[Client Sends Command] --> B{Validate Request}
    B -->|Valid| C[Process Command]
    B -->|Invalid| D[Return Failure]
    C --> E{Command Type}
    E -->|GetTasks| F[Retrieve Tasks]
    E -->|SetProperties| G[Update Properties]
    E -->|Heartbeat| H[Acknowledge]
    F --> I[Return Success]
    G --> I
    H --> I
    I --> J[Send Response to Client]
    D --> J

Error Handling Flow

flowchart TD
    A[Receive Command] --> B{Authentication}
    B -->|Fail| C[Return PERMISSION_DENIED]
    B -->|Pass| D{Parse Command}
    D -->|Fail| E[Return INVALID_REQUEST]
    D -->|Pass| F{Execute}
    F -->|Error| G[Return INTERNAL_ERROR]
    F -->|Timeout| H[Return TIMEOUT]
    F -->|Success| I[Return SUCCESS]