Skip to content

Commit 762d7aa

Browse files
KixironJoshua Nelson
authored andcommitted
Enabled the threaded tokio runtime
1 parent 8518f63 commit 762d7aa

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ rusoto_credential = "0.43"
5151

5252
# Async
5353
futures = "0.3"
54-
tokio = "0.2"
54+
tokio = { version = "0.2", features = ["rt-threaded"] }
5555

5656
[target.'cfg(not(windows))'.dependencies]
5757
libc = "0.2"

src/storage/s3/test.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ impl TestS3 {
5454

5555
impl Drop for TestS3 {
5656
fn drop(&mut self) {
57-
let mut runtime = Runtime::new().unwrap();
58-
5957
// delete the bucket when the test ends
6058
// this has to delete all the objects in the bucket first or min.io will give an error
6159
let inner = self.0.borrow();
@@ -64,7 +62,9 @@ impl Drop for TestS3 {
6462
..Default::default()
6563
};
6664

67-
let objects = runtime
65+
let objects = inner
66+
.runtime
67+
.handle()
6868
.block_on(inner.client.list_objects(list_req))
6969
.unwrap();
7070
assert!(!objects.is_truncated.unwrap_or(false));
@@ -76,7 +76,9 @@ impl Drop for TestS3 {
7676
..Default::default()
7777
};
7878

79-
runtime
79+
inner
80+
.runtime
81+
.handle()
8082
.block_on(inner.client.delete_object(delete_req))
8183
.unwrap();
8284
}
@@ -85,7 +87,9 @@ impl Drop for TestS3 {
8587
bucket: inner.bucket.to_owned(),
8688
};
8789

88-
runtime
90+
inner
91+
.runtime
92+
.handle()
8993
.block_on(inner.client.delete_bucket(delete_req))
9094
.expect("failed to delete test bucket");
9195
}

test.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Compiling tokio v0.2.21
2+
Compiling cratesfyi v0.6.0 (G:\Users\Chase\Code\Rust\docs.rs)
3+
Compiling tokio-util v0.3.1
4+
Compiling tokio-tls v0.3.1

0 commit comments

Comments
 (0)