Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix major versions in Cargo.toml + Add FnOnce callback #1

Merged
merged 1 commit into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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