# aliabbas299792/event_manager architecture

> Architecture diagram of the GitHub repository aliabbas299792/event_manager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aliabbas299792/event_manager
- Repository: https://github.com/aliabbas299792/event_manager

## Overview

##### Main Components

a) Core Components:
- Event Manager (Central Component)
- Coroutine System
- IO Operations Handler
- Communication System
- Error Handling System

b) Supporting Components:
- Request Queue System
- Response Handling System
- IO Awaitables
- liburing Integration

##### Key Relationships to Highlight

- Data flow (→): Show how requests flow through the system
- Dependencies (⇢): Indicate component dependencies
- Async operations (⇢⇢): Show coroutine suspension points

##### Specific Component Details

EventManager:
- Queue depth management
- Coroutine registration system
- Request queue creation
- Operation submission flow

Coroutine System:
- EvTask implementation
- IO Awaitables
- Suspension/Resume mechanics

Communication System:
- Request types
- Response packs
- Parameter packs

##### Detailed Component Relationships

**[User Code] → [EventManager]**
- ↓
**[Coroutine System] ↔ [IO Awaitables]**
- ↓
**[Request Queue] → [IO Operations]**
- ↓
**[liburing Interface] → [System IO]**

##### Implementation Details

- Request type enum mapping
- Response data type mapping
- Parameter pack structures
- IO operation preparation
- Completion handling

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph User_Layer
        UC[User Code]
    end

    subgraph Core_Processing
        EM[Event Manager]:::core
        CS[Coroutine System]:::core
        IOH[IO Operations Handler]:::core
        RQS[Request Queue System]:::core
    end

    subgraph Communication_Layer
        COMM[Communication System]:::comm
        RHS[Response Handling System]:::comm
    end

    subgraph Coroutine_Components
        IOA[IO Awaitables]:::coro
        ET[EvTask]:::coro
    end

    subgraph System_Integration
        LIUR[liburing Interface]:::sys
        SYIO[System IO]:::sys
    end

    subgraph Error_Handling
        EHS[Error Handling System]:::error
    end

    %% Relationships
    UC --> EM
    EM --> CS
    EM --> RQS
    CS --> IOA
    CS --> ET
    IOH --> LIUR
    RQS --> IOH
    COMM --> RHS
    IOH --> COMM
    LIUR --> SYIO
    
    %% Error handling relationships
    EHS --> EM
    EHS --> CS
    EHS --> IOH
    EHS --> COMM

    %% Styles
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef comm fill:#2ecc71,stroke:#27ae60,color:white
    classDef coro fill:#e74c3c,stroke:#c0392b,color:white
    classDef sys fill:#f39c12,stroke:#d35400,color:white
    classDef error fill:#e74c3c,stroke:#c0392b,color:white

    %% Click events
    click EM "https://github.com/aliabbas299792/event_manager/blob/main/event_loop/event_manager.hpp"
    click CS "https://github.com/aliabbas299792/event_manager/blob/main/coroutine/task.hpp"
    click IOH "https://github.com/aliabbas299792/event_manager/blob/main/event_loop/io_ops.cpp"
    click COMM "https://github.com/aliabbas299792/event_manager/blob/main/communication/communication_channel.hpp"
    click RHS "https://github.com/aliabbas299792/event_manager/blob/main/communication/response_packs.hpp"
    click IOA "https://github.com/aliabbas299792/event_manager/blob/main/coroutine/io_awaitables.hpp"
    click RQS "https://github.com/aliabbas299792/event_manager/blob/main/event_loop/request_data.hpp"
    click EHS "https://github.com/aliabbas299792/event_manager/blob/main/errors.hpp"

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Communication Components]:::comm
        L3[Coroutine Components]:::coro
        L4[System Components]:::sys
        L5[Error Handling]:::error
    end
```
