Справочник¶
Константы и дефолты¶
| Константа | Значение | Расположение |
|---|---|---|
DEFAULT_TIMEOUT |
10s | client/src/lib.rs |
| Publisher retry check interval | 100ms | client/src/publisher.rs |
| Server retry check interval | 500ms | server/src/lib.rs |
DEFAULT_IN_MEMORY_LIMIT_BYTES |
100 MB | client/src/publisher.rs |
max_subscriber_retries |
3 | ServerConfig::default() |
subscriber_retry_timeout |
10s | ServerConfig::default() |
subscriber_window_size |
128 | ServerConfig::default() |
| Default server port | 7427 | server/src/main.rs |
SEQ_NONE (wire sentinel) |
u64::MAX |
sharp/src/packet/mod.rs |
| Min packet size (Ping) | 30 bytes | Protocol spec |
Карта файлов¶
sharp/ Cargo workspace root
├── Cargo.toml Workspace definition
├── MANUAL.md ← этот документ
├── TODO.md Roadmap
├── CLAUDE.md AI assistant instructions
├── flamegraph.svg CPU profiling output
│
├── sharp/ Core protocol library
│ ├── Cargo.toml
│ └── src/
│ ├── lib.rs Public exports, generate_nonce()
│ ├── packet/
│ │ ├── mod.rs Packet, PacketType, serialization
│ │ └── codec.rs PacketCodec (Encoder + Decoder)
│ ├── data.rs Data enum (Message, Ack, Nack, Ping, Connect)
│ ├── message.rs Message wrapper over Bytes
│ ├── connection.rs Connection, ConnectionType
│ ├── duplex.rs run_connection() — poll_fn loop
│ ├── notify_channel.rs NotifyChannel<T>
│ └── tests.rs Protocol unit tests
│
├── client/ Client library
│ ├── Cargo.toml
│ └── src/
│ ├── lib.rs Exports, DEFAULT_TIMEOUT
│ ├── publisher.rs Publish trait, Publisher
│ ├── subscriber.rs Subscribe trait, Subscriber
│ └── wal.rs Write-Ahead Log
│
├── server/ MQ server
│ ├── Cargo.toml
│ └── src/
│ ├── main.rs Binary entry point (port 7427)
│ ├── lib.rs Server logic, ServerConfig, SubscriberWindow
│ └── tests/
│ ├── mod.rs
│ ├── multi_sub_tests.rs Multi-subscriber delivery tests
│ ├── nack_tests.rs NACK handling tests
│ └── ordering_tests.rs Ordering and window tests
│
└── bench/ Benchmark tool
├── Cargo.toml
└── src/
└── main.rs CLI + benchmark modes
Зависимости¶
| Крейт | Зависимости |
|---|---|
sharp |
bytes, futures, tokio, tokio-util, rand |
client |
sharp, tokio, async-trait, futures, tokio-util, indexmap |
server |
sharp, tokio, futures, tokio-util, dashmap, rlg |
bench |
sharp, client, tokio, bytes, clap, dialoguer |