Skip to content

Commit

Permalink
Merge pull request #1 from boltlabs-inc/fix-integration-test
Browse files Browse the repository at this point in the history
Fix major versions in Cargo.toml + Add FnOnce callback
  • Loading branch information
gijsvl authored Apr 19, 2022
2 parents 7005ed6 + 2e2c15a commit 8bacae6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
24 changes: 12 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ path = "src/lib.rs"
allow_explicit_certificate_trust = []

[dependencies]
bincode = "*"
tokio = { version = "*", features = ["full"] }
tokio-rustls = "*"
rustls = "*"
futures = "*"
serde = "*"
bincode = "1"
tokio = { version = "1", features = ["full"] }
tokio-rustls = "0"
rustls = "0"
futures = "0"
serde = "1"
dialectic = { git = "https://github.com/boltlabs-inc/dialectic.git", branch = "main" }
dialectic-tokio-serde = { git = "https://github.com/boltlabs-inc/dialectic.git", branch = "main" }
dialectic-tokio-serde-bincode = { git = "https://github.com/boltlabs-inc/dialectic.git", branch = "main" }
dialectic-reconnect = { features = ["serde", "humantime-serde"], git = "https://github.com/boltlabs-inc/dialectic.git", branch = "main" }
uuid = { version = "*", features = ["serde", "v4"] }
tracing = "*"
thiserror = "*"
webpki = "*"
webpki-roots = "*"
pem = "*"
uuid = { version = "0", features = ["serde", "v4"] }
tracing = "0"
thiserror = "1"
webpki = "0"
webpki-roots = "0"
pem = "1"


7 changes: 4 additions & 3 deletions src/server.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! The server side of Zeekoe's transport layer.
use tracing::info;
use {
dialectic::prelude::*,
dialectic_reconnect::resume,
Expand Down Expand Up @@ -122,6 +121,7 @@ where
/// Note that `initialize` runs sequentially: it can pause the server if desired by
/// `.await`-ing.
pub async fn serve_while<
'a,
Input,
Error,
Init,
Expand All @@ -130,12 +130,13 @@ where
InteractionFut,
TerminateFut,
>(
&self,
&'a self,
address: impl Into<SocketAddr>,
tls_config: Option<(&Path, &Path)>,
mut initialize: Init,
interact: Interaction,
terminate: TerminateFut,
on_running: impl FnOnce(String) + 'a,
) -> Result<(), io::Error>
where
Input: Send + 'static,
Expand Down Expand Up @@ -197,7 +198,7 @@ where

// Bind to the address and serve
let address = address.into();
info!("{}", format!("serving on: {:?}", address.to_string()));
on_running(address.to_string());
let listener = TcpListener::bind(address).await?;

// Loop over incoming TCP connections until `initialize` returns `None`
Expand Down

0 comments on commit 8bacae6

Please sign in to comment.