https://github.com/vimkim/file-stat.rs
tokio-based file stat server that handles parallel requests
https://github.com/vimkim/file-stat.rs
Last synced: 10 months ago
JSON representation
tokio-based file stat server that handles parallel requests
- Host: GitHub
- URL: https://github.com/vimkim/file-stat.rs
- Owner: vimkim
- Created: 2024-09-06T18:11:51.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-06T18:23:40.000Z (almost 2 years ago)
- Last Synced: 2024-09-06T21:49:01.365Z (almost 2 years ago)
- Language: Rust
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# File Stat Server in Rust
A demo server to learn rust concurrency and async operations with tokio.
You should prepare a large random file (5 - 10 MB) to test this.
The client queries the word count and line count of the file to the server.


### prepare
```bash
seq 10000 > large.txt
```
### basic usage
```
# server
cargo run
```
```
# client
cargo run
```
### Have fun
```bash
seq 1 20 | xargs -I {} -P 20 target/debug/file-stat-client "/large-file.txt" {}
# or
parallel -j 20 target/debug/file-stat-client "/large-file.txt" ::: {1..20}
```
The results will let you understand the basics of rust concurrency.
---