# albanix/runtime architecture

> Architecture diagram of the GitHub repository albanix/runtime, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/albanix/runtime
- Repository: https://github.com/albanix/runtime

## Overview

Це невеликий Linux-орієнтований async runtime: користувач ставить futures у чергу Executor, а Executor запускає їх опитування. Окрема Reactor реєструє файлові дескриптори через epoll і пробуджує збережений Waker, який може повторно поставити задачу в чергу. У README описано запуск задач; джерело також показує механізм очікування готовності fd. Не показано, як futures отримують Reactor чи реєструють fd, тож цей зв’язок не домальовано.

Main entry points: [`src/lib.rs`](https://github.com/albanix/runtime/blob/master/src/lib.rs) (Reactor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scheduling["Планування задач"]
  node_executor["Executor<br/>[lib.rs]"]
  node_queue["Черга задач<br/>[lib.rs]"]
  node_task["Task / Waker<br/>[lib.rs]"]
end

subgraph group_io["Готовність вводу-виводу"]
  node_reactor["Reactor<br/>[lib.rs]"]
  node_epoll["Linux epoll"]
end

node_user(("Користувач"))

node_user -->|"spawn / run"| node_executor
node_user -->|"register fd"| node_reactor
node_executor -->|"ставить задачі"| node_queue
node_executor -->|"діставати задачі"| node_queue
node_executor -->|"опитувати future"| node_task
node_task -->|"повторно ставити"| node_queue
node_reactor -->|"реєструвати fd"| node_epoll
node_reactor -->|"чекати події"| node_epoll
node_epoll -->|"повідомляти готовність"| node_reactor
node_reactor -->|"будити Waker"| node_task

click node_executor "https://github.com/albanix/runtime/blob/master/src/lib.rs"
click node_queue "https://github.com/albanix/runtime/blob/master/src/lib.rs"
click node_task "https://github.com/albanix/runtime/blob/master/src/lib.rs"
click node_reactor "https://github.com/albanix/runtime/blob/master/src/lib.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_executor,node_queue,node_task toneBlue
class node_reactor,node_epoll toneAmber
class node_user toneIndigo
```

## Components

### Планування задач

- [Executor](https://github.com/albanix/runtime/blob/master/src/lib.rs): `src/lib.rs`
- [Черга задач](https://github.com/albanix/runtime/blob/master/src/lib.rs): `src/lib.rs`
- [Task / Waker](https://github.com/albanix/runtime/blob/master/src/lib.rs): `src/lib.rs`

### Готовність вводу-виводу

- [Reactor](https://github.com/albanix/runtime/blob/master/src/lib.rs): `src/lib.rs`
- **Linux epoll**

### Other components

- **Користувач**

## Connections

- Користувач → Executor: spawn / run
- Користувач → Reactor: register fd
- Executor → Черга задач: ставить задачі
- Executor → Черга задач: діставати задачі
- Executor → Task / Waker: опитувати future
- Task / Waker → Черга задач: повторно ставити
- Reactor → Linux epoll: реєструвати fd
- Reactor → Linux epoll: чекати події
- Linux epoll → Reactor: повідомляти готовність
- Reactor → Task / Waker: будити Waker
