Skip to content

Commit

Permalink
File examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tyt2y3 committed Jul 11, 2023
1 parent ff4cfdb commit f5ef40e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tokio = { version = "1.10", features = ["full"], optional = true }
[dependencies.sea-streamer]
path = ".." # remove this line in your own project
version = "0.3"
features = ["kafka", "redis", "stdio", "socket"]
features = ["kafka", "redis", "stdio", "file", "socket"]

[features]
default = ["runtime-tokio"]
Expand Down
14 changes: 14 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ cargo run --bin consumer -- --stream redis://localhost:6379/hello2
kill %1 %2
```

With File:

```bash
# Create the file
file=/tmp/sea-streamer-$(date +%s)
touch $file && echo "File created at $file"
# Produce some input
cargo run --bin producer -- --stream file://$file/hello &
# Replay the input
cargo run --bin consumer -- --stream file://$file/hello
# Start the processor, producing some output
cargo run --bin processor -- --input file://$file/hello --output stdio:///hello
```

With Stdio:

```bash
Expand Down

0 comments on commit f5ef40e

Please sign in to comment.