Skip to content

Commit d533676

Browse files
committed
upgrade to tokio v1
Signed-off-by: Petros Angelatos <[email protected]>
1 parent 2505adb commit d533676

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Build Status](https://travis-ci.com/pubnub/rust.svg?branch=master)](https://travis-ci.com/pubnub/rust)
44
[![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/)
55

6-
The PubNub Rust SDK is based on Tokio `0.2`. This library uses `HTTP/2` to communicate with the PubNub Edge Messaging Network.
6+
The PubNub Rust SDK is based on Tokio `1.0`. This library uses `HTTP/2` to communicate with the PubNub Edge Messaging Network.
77

88
## MSRV
99

pubnub-hyper/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ error-iter = "0.2"
2020
futures-util = { version = "0.3", features = ["async-await", "async-await-macro"] }
2121
getset = "0.1"
2222
http = "0.2"
23-
hyper = { version = "0.13.3", features = ["stream"] }
24-
hyper-tls = "0.4"
23+
hyper = { version = "0.14", features = ["client", "http1", "http2", "stream"] }
24+
hyper-tls = "0.5"
2525
log = "0.4"
2626
thiserror = "1.0"
27-
tokio = "0.2"
27+
tokio = { version = "1", features = ["rt-multi-thread"] }
2828

2929
[dev-dependencies]
3030
pubnub-test-util = { version = "0.1", path = "../pubnub-test-util" }
@@ -37,7 +37,7 @@ json = "0.12"
3737
log = "0.4"
3838
percent-encoding = "2.1"
3939
randomize = "3.0"
40-
tokio = { version = "0.2", features = ["macros"] }
40+
tokio = { version = "1", features = ["macros", "time"] }
4141

4242
[badges]
4343
travis-ci = { repository = "pubnub/rust", branch = "master" }

pubnub-hyper/tests/common/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ pub fn init() {
55
}
66

77
pub fn current_thread_block_on<F: Future>(future: F) -> F::Output {
8-
let mut rt = tokio::runtime::Builder::new()
8+
let rt = tokio::runtime::Builder::new_current_thread()
99
.enable_all()
10-
.basic_scheduler()
1110
.build()
1211
.expect("unable to build tokio runtime");
1312
rt.block_on(future)

pubnub-hyper/tests/history.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mod common;
1010
/// Delay execution for the specified amount of milliseconds.
1111
async fn sleep(ms: u64) {
1212
info!(target: "pubnub", "Sleeping for {} ms", ms);
13-
tokio::time::delay_for(std::time::Duration::from_millis(ms)).await
13+
tokio::time::sleep(std::time::Duration::from_millis(ms)).await
1414
}
1515

1616
/// Generate a string of random numbers.

pubnub-hyper/tests/presence.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const SAMPLE_UUID: &str = "903145ee-7c15-4579-aa5d-38a900717512";
1616
/// Delay execution for the specified amount of milliseconds.
1717
async fn sleep(ms: u64) {
1818
info!(target: "pubnub", "Sleeping for {} ms", ms);
19-
tokio::time::delay_for(std::time::Duration::from_millis(ms)).await
19+
tokio::time::sleep(std::time::Duration::from_millis(ms)).await
2020
}
2121

2222
/// Generate a string of random numbers.

0 commit comments

Comments
 (0)