Skip to content

Commit af928fe

Browse files
committed
rename and fix warnings
1 parent a69d4bf commit af928fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+321
-311
lines changed

Cargo.toml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
[package]
2-
name = "tokio-uring"
2+
name = "tokio-uring-ooo"
33
version = "0.4.0"
4-
authors = ["Tokio Contributors <team@tokio.rs>"]
5-
edition = "2018"
4+
authors = [
5+
"Tokio Contributors <team@tokio.rs>",
6+
"Ahmed Mones <oneofone@gmail.com>",
7+
]
8+
edition = "2021"
69
readme = "README.md"
710
license = "MIT"
8-
documentation = "https://docs.rs/tokio-uring/0.4.0/tokio-uring"
9-
repository = "https://github.com/tokio-rs/tokio-uring"
11+
documentation = "https://docs.rs/tokio-uring-ooo"
12+
repository = "https://github.com/ooo-rs/tokio-uring"
1013
homepage = "https://tokio.rs"
1114
description = """
1215
io-uring support for the Tokio asynchronous runtime.
@@ -17,22 +20,22 @@ keywords = ["async", "fs", "io-uring"]
1720
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1821

1922
[dependencies]
20-
tokio = { version = "1.2", features = ["net", "rt", "sync"] }
23+
tokio = { version = "1", features = ["net", "rt", "sync"] }
2124
slab = "0.4.2"
2225
libc = "0.2.80"
23-
io-uring = "0.6.0"
24-
socket2 = { version = "0.4.4", features = ["all"] }
25-
bytes = { version = "1.0", optional = true }
26-
futures-util = { version = "0.3.26", default-features = false, features = ["std"] }
26+
io-uring-ooo = { version = "0.6", path = "../io-uring-ooo" }
27+
socket2 = { version = "0.5", features = ["all"] }
28+
bytes = { version = "1.6", optional = true }
29+
futures-util = { version = "0.3", default-features = false, features = ["std"] }
2730

2831
[dev-dependencies]
2932
tempfile = "3.2.0"
3033
tokio-test = "0.4.2"
3134
iai = "0.1.1"
32-
criterion = "0.4.0"
35+
criterion = "0.5"
3336
# we use joinset in our tests
34-
tokio = "1.21.2"
35-
nix = "0.26.1"
37+
tokio = "1"
38+
nix = "0.28"
3639

3740
[package.metadata.docs.rs]
3841
all-features = true

DESIGN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ tokio-uring = "0.1"
5555

5656
```rust
5757
fn main() {
58-
let rt = tokio_uring::runtime::Runtime::new().unwrap();
58+
let rt = tokio_uring_ooo::runtime::Runtime::new().unwrap();
5959
rt.block_on(async {
6060
// The rest of the application comes here.
6161
});
@@ -185,7 +185,7 @@ at compile time. The following example demonstrates reading and writing with a
185185
file resource.
186186

187187
```rust
188-
use tokio_uring::buf;
188+
use tokio_uring_ooo::buf;
189189

190190
/// The result of an operation that includes a buffer. The buffer must
191191
/// be returned to the caller when the operation completes successfully
@@ -254,7 +254,7 @@ let my_pool = BufferPool::builder()
254254
.build();
255255

256256
// Create the runtime
257-
let mut rt = tokio_uring::runtime::Runtime::new()?;
257+
let mut rt = tokio_uring_ooo::runtime::Runtime::new()?;
258258

259259
// Provide the buffer pool to the kernel. This passes
260260
// ownership of the pool to the kernel.
@@ -525,8 +525,8 @@ within the runtime context at compile time. Attempting to use a tokio-uring
525525
resource from outside of the runtime will result in a panic.
526526

527527
```rust
528-
use tokio_uring::runtime::Runtime;
529-
use tokio_uring::net::TcpListener;
528+
use tokio_uring_ooo::runtime::Runtime;
529+
use tokio_uring_ooo::net::TcpListener;
530530

531531
fn main() {
532532
// Binding a TcpListener does not require access to the runtime.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ tokio-uring = { version = "0.4.0" }
2424
```
2525
In your main.rs:
2626
```rust
27-
use tokio_uring::fs::File;
27+
use tokio_uring_ooo::fs::File;
2828

2929
fn main() -> Result<(), Box<dyn std::error::Error>> {
30-
tokio_uring::start(async {
30+
tokio_uring_ooo::start(async {
3131
// Open a file
3232
let file = File::open("hello.txt").await?;
3333

benches/criterion/no_op.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ impl Default for Options {
2525
}
2626

2727
fn run_no_ops(opts: &Options, count: u64) -> Duration {
28-
let mut ring_opts = tokio_uring::uring_builder();
28+
let mut ring_opts = tokio_uring_ooo::uring_builder();
2929
ring_opts.setup_cqsize(opts.cq_size as _);
3030

3131
let mut m = Duration::ZERO;
3232

3333
// Run the required number of iterations
3434
for _ in 0..count {
35-
m += tokio_uring::builder()
35+
m += tokio_uring_ooo::builder()
3636
.entries(opts.sq_size as _)
3737
.uring_builder(&ring_opts)
3838
.start(async move {
3939
let mut js = JoinSet::new();
4040

4141
for _ in 0..opts.iterations {
42-
js.spawn_local(tokio_uring::no_op());
42+
js.spawn_local(tokio_uring_ooo::no_op());
4343
}
4444

4545
let start = Instant::now();

benches/lai/no_op.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,27 @@ impl Default for Options {
2222

2323
fn runtime_only() -> Result<(), Box<dyn std::error::Error>> {
2424
let opts = Options::default();
25-
let mut ring_opts = tokio_uring::uring_builder();
25+
let mut ring_opts = tokio_uring_ooo::uring_builder();
2626
ring_opts.setup_cqsize(opts.cq_size as _);
2727

28-
tokio_uring::builder()
28+
tokio_uring_ooo::builder()
2929
.entries(opts.sq_size as _)
3030
.uring_builder(&ring_opts)
3131
.start(async move { black_box(Ok(())) })
3232
}
3333

3434
fn run_no_ops(opts: Options) -> Result<(), Box<dyn std::error::Error>> {
35-
let mut ring_opts = tokio_uring::uring_builder();
35+
let mut ring_opts = tokio_uring_ooo::uring_builder();
3636
ring_opts.setup_cqsize(opts.cq_size as _);
3737

38-
tokio_uring::builder()
38+
tokio_uring_ooo::builder()
3939
.entries(opts.sq_size as _)
4040
.uring_builder(&ring_opts)
4141
.start(async move {
4242
let mut js = JoinSet::new();
4343

4444
for _ in 0..opts.iterations {
45-
js.spawn_local(tokio_uring::no_op());
45+
js.spawn_local(tokio_uring_ooo::no_op());
4646
}
4747

4848
while let Some(res) = js.join_next().await {

examples/cat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{
33
{env, io},
44
};
55

6-
use tokio_uring::fs::File;
6+
use tokio_uring_ooo::fs::File;
77

88
fn main() {
99
// The file to `cat` is passed as a CLI argument
@@ -19,7 +19,7 @@ fn main() {
1919
let out = io::stdout();
2020
let mut out = out.lock();
2121

22-
tokio_uring::start(async {
22+
tokio_uring_ooo::start(async {
2323
// Open the file without blocking
2424
let file = File::open(path).await.unwrap();
2525
let mut buf = vec![0; 16 * 1_024];

examples/mix.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use std::env;
66

7-
use tokio_uring::{fs::File, net::TcpListener};
7+
use tokio_uring_ooo::{fs::File, net::TcpListener};
88

99
fn main() {
1010
// The file to serve over TCP is passed as a CLI argument
@@ -14,7 +14,7 @@ fn main() {
1414
panic!("no path specified");
1515
}
1616

17-
tokio_uring::start(async {
17+
tokio_uring_ooo::start(async {
1818
// Start a TCP listener
1919
let listener = TcpListener::bind("0.0.0.0:8080".parse().unwrap()).unwrap();
2020

@@ -24,7 +24,7 @@ fn main() {
2424
let path = args[1].clone();
2525

2626
// Spawn a task to send the file back to the socket
27-
tokio_uring::spawn(async move {
27+
tokio_uring_ooo::spawn(async move {
2828
// Open the file without blocking
2929
let file = File::open(path).await.unwrap();
3030
let mut buf = vec![0; 16 * 1_024];

examples/tcp_listener.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{env, net::SocketAddr};
22

3-
use tokio_uring::net::TcpListener;
3+
use tokio_uring_ooo::net::TcpListener;
44

55
fn main() {
66
let args: Vec<_> = env::args().collect();
@@ -12,17 +12,17 @@ fn main() {
1212
};
1313
let socket_addr: SocketAddr = socket_addr.parse().unwrap();
1414

15-
tokio_uring::start(async {
15+
tokio_uring_ooo::start(async {
1616
let listener = TcpListener::bind(socket_addr).unwrap();
1717

1818
println!("Listening on {}", listener.local_addr().unwrap());
1919

2020
loop {
2121
let (stream, socket_addr) = listener.accept().await.unwrap();
22-
tokio_uring::spawn(async move {
22+
tokio_uring_ooo::spawn(async move {
2323
// implement ping-pong loop
2424

25-
use tokio_uring::buf::BoundedBuf; // for slice()
25+
use tokio_uring_ooo::buf::BoundedBuf; // for slice()
2626

2727
println!("{} connected", socket_addr);
2828
let mut n = 0;

examples/tcp_listener_fixed_buffers.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use std::{env, iter, net::SocketAddr};
55

6-
use tokio_uring::{
6+
use tokio_uring_ooo::{
77
buf::{fixed::FixedBufRegistry, BoundedBuf, IoBufMut},
88
net::{TcpListener, TcpStream},
99
}; // BoundedBuf for slice method
@@ -21,7 +21,7 @@ fn main() {
2121
};
2222
let socket_addr: SocketAddr = socket_addr.parse().unwrap();
2323

24-
tokio_uring::start(accept_loop(socket_addr));
24+
tokio_uring_ooo::start(accept_loop(socket_addr));
2525
}
2626

2727
// Bind to address and accept connections, spawning an echo handler for each connection.
@@ -43,7 +43,7 @@ async fn accept_loop(listen_addr: SocketAddr) {
4343
loop {
4444
let (stream, peer) = listener.accept().await.unwrap();
4545

46-
tokio_uring::spawn(echo_handler(stream, peer, registry.clone()));
46+
tokio_uring_ooo::spawn(echo_handler(stream, peer, registry.clone()));
4747
}
4848
}
4949

examples/tcp_stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{env, net::SocketAddr};
22

3-
use tokio_uring::net::TcpStream;
3+
use tokio_uring_ooo::net::TcpStream;
44

55
fn main() {
66
let args: Vec<_> = env::args().collect();
@@ -11,7 +11,7 @@ fn main() {
1111

1212
let socket_addr: SocketAddr = args[1].parse().unwrap();
1313

14-
tokio_uring::start(async {
14+
tokio_uring_ooo::start(async {
1515
let stream = TcpStream::connect(socket_addr).await.unwrap();
1616
let buf = vec![1u8; 128];
1717

0 commit comments

Comments
 (0)