arti-hyper: Move hyper example from arti-client
Code motion and consequential dependency adjustments.
This commit is contained in:
parent
0f80be6b35
commit
0cf9751d7f
|
@ -126,7 +126,6 @@ dependencies = [
|
|||
"directories",
|
||||
"futures",
|
||||
"humantime-serde",
|
||||
"hyper",
|
||||
"once_cell",
|
||||
"pin-project",
|
||||
"postage",
|
||||
|
@ -168,8 +167,13 @@ dependencies = [
|
|||
name = "arti-hyper"
|
||||
version = "0.0.4"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"arti-client",
|
||||
"hyper",
|
||||
"pin-project",
|
||||
"tokio",
|
||||
"tor-rtcompat",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -48,7 +48,6 @@ thiserror = "1"
|
|||
[dev-dependencies]
|
||||
tor-rtcompat = { path="../tor-rtcompat", version = "0.0.4", features=["tokio", "native-tls" ] }
|
||||
tokio-crate = { package = "tokio", version = "1.4", features = ["rt", "rt-multi-thread", "io-util", "net", "time", "macros" ] }
|
||||
hyper = { version = "0.14", features = ["http1", "client", "runtime"] }
|
||||
pin-project = "1"
|
||||
tokio-util = { version = "0.6", features = ["compat"] }
|
||||
anyhow = "1.0.23"
|
||||
|
|
|
@ -12,8 +12,8 @@ repository="https://gitlab.torproject.org/tpo/core/arti.git/"
|
|||
|
||||
[features]
|
||||
default = [ "native-tls" ]
|
||||
native-tls = [ "arti-client/native-tls" ]
|
||||
rustls = [ "arti-client/rustls" ]
|
||||
native-tls = [ "arti-client/native-tls", "tor-rtcompat/native-tls" ]
|
||||
rustls = [ "arti-client/rustls", "tor-rtcompat/rustls" ]
|
||||
static = [ "arti-client/static" ]
|
||||
|
||||
# Enable experimental APIs that are not yet officially supported.
|
||||
|
@ -25,5 +25,10 @@ experimental-api = []
|
|||
[dependencies]
|
||||
arti-client = { path="../arti-client", version = "0.0.4"}
|
||||
hyper = { version = "0.14", features = ["http1", "client", "runtime"] }
|
||||
pin-project = "1"
|
||||
tokio = { package = "tokio", version = "1.4", features = ["rt", "rt-multi-thread", "io-util", "net", "time", "macros" ] }
|
||||
tor-rtcompat = { path="../tor-rtcompat", version = "0.0.4", features=["tokio"] }
|
||||
|
||||
[dev-dependencies]
|
||||
anyhow = "1.0.23"
|
||||
tracing-subscriber = "0.3.0"
|
||||
|
|
|
@ -12,7 +12,6 @@ use std::io::Error;
|
|||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};
|
||||
use tokio_crate as tokio;
|
||||
use tor_rtcompat::tokio::TokioNativeTlsRuntime;
|
||||
use tor_rtcompat::Runtime;
|
||||
|
||||
|
@ -138,7 +137,7 @@ async fn main() -> Result<()> {
|
|||
// on Linux platforms)
|
||||
let config = TorClientConfig::default();
|
||||
// Arti needs an async runtime handle to spawn async tasks.
|
||||
let rt: TokioNativeTlsRuntime = tokio_crate::runtime::Handle::current().into();
|
||||
let rt: TokioNativeTlsRuntime = tokio::runtime::Handle::current().into();
|
||||
|
||||
// We now let the Arti client start and bootstrap a connection to the network.
|
||||
// (This takes a while to gather the necessary consensus state, etc.)
|
Loading…
Reference in New Issue