https://github.com/synoet/sturgeon
record and replay rust streams with timing
https://github.com/synoet/sturgeon
async rust rust-crate streams websocket websockets
Last synced: 8 months ago
JSON representation
record and replay rust streams with timing
- Host: GitHub
- URL: https://github.com/synoet/sturgeon
- Owner: synoet
- Created: 2025-10-03T03:35:34.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-10-03T03:55:51.000Z (9 months ago)
- Last Synced: 2025-10-03T05:43:18.525Z (9 months ago)
- Topics: async, rust, rust-crate, streams, websocket, websockets
- Language: Rust
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sturgeon
Record and replay streams with timing.
## Example
```rust
use futures::StreamExt;
// record a stream
let mut recorded = sturgeon::record(websocket_stream);
while let Some(msg) = recorded.next().await {
handle(msg).await;
}
// replay returns a stream with original timing
let mut replay = recorded.replay();
while let Some(msg) = replay.next().await {}
// replay from specific timestamp
let mut replay = recorded.replay_since(Instant::now() - Duration::from_secs(10));
```