Server::build() method (#315)

This commit is contained in:
Nikolay Kim 2024-03-24 16:15:42 +01:00 committed by GitHub
parent baabcff4a6
commit 20a53c3fd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 11 additions and 137 deletions

View file

@ -4,7 +4,6 @@ members = [
"ntex",
"ntex-bytes",
"ntex-codec",
"ntex-connect",
"ntex-io",
"ntex-http",
"ntex-router",
@ -24,7 +23,6 @@ members = [
ntex = { path = "ntex" }
ntex-bytes = { path = "ntex-bytes" }
ntex-codec = { path = "ntex-codec" }
ntex-connect = { path = "ntex-connect" }
ntex-io = { path = "ntex-io" }
ntex-net = { path = "ntex-net" }
ntex-http = { path = "ntex-http" }

View file

@ -1,59 +0,0 @@
# Changes
## [1.0.0] - 2024-01-09
* Release
## [1.0.0-b.1] - 2024-01-08
* Refactor io tls filters
* Remove unnecessary 'static
## [1.0.0-b.0] - 2024-01-07
* Use "async fn" in trait for Service definition
## [0.3.4] - 2023-12-14
* Better io tag handling
## [0.3.3] - 2023-12-12
* Add io tag support
## [0.3.2] - 2023-10-02
* Add `Clone` impl for `Connect<T>` type
## [0.3.1] - 2023-09-11
* Add missing fmt::Debug impls
## [0.3.0] - 2023-06-22
* Release v0.3.0
## [0.3.0-beta.0] - 2023-06-16
* Migrate to ntex-service 1.2
## [0.2.1] - 2023-01-23
* Use new Io object
## [0.2.0] - 2023-01-04
* Release
## [0.2.0-beta.0] - 2022-12-28
* Migrate to ntex-service 1.0
## [0.1.1] - 2022-12-08
* Remove port from host for openssl connector #152
## [0.1.0] - 2022-06-20
* Move to separate crate

View file

@ -1,48 +0,0 @@
[package]
name = "ntex-connect"
version = "1.1.0"
authors = ["ntex contributors <team@ntex.rs>"]
description = "ntexwork connect utils for ntex framework"
keywords = ["network", "framework", "async", "futures"]
homepage = "https://ntex.rs"
repository = "https://github.com/ntex-rs/ntex.git"
documentation = "https://docs.rs/ntex-connect/"
categories = ["network-programming", "asynchronous"]
license = "MIT OR Apache-2.0"
edition = "2021"
[lib]
name = "ntex_connect"
path = "src/lib.rs"
[features]
default = []
# openssl
openssl = ["ntex-tls/openssl", "tls_openssl"]
# rustls support
rustls = ["ntex-tls/rustls", "tls_rust"]
# tokio runtime
tokio = ["ntex-net/tokio"]
# glommio runtime
glommio = ["ntex-net/glommio"]
# async-std runtime
async-std = ["ntex-net/async-std"]
[dependencies]
ntex-io = "1.0.0"
ntex-net = "1.0"
ntex-tls = "1.1"
log = "0.4"
thiserror = "1.0"
# openssl
tls_openssl = { version = "0.10", package = "openssl", optional = true }
# rustls
tls_rust = { version = "0.23", package = "rustls", optional = true }

View file

@ -1 +0,0 @@
../LICENSE-APACHE

View file

@ -1 +0,0 @@
../LICENSE-MIT

View file

@ -1,24 +0,0 @@
//! Tcp connector service
#![deny(rust_2018_idioms, unreachable_pub, missing_debug_implementations)]
#[cfg(feature = "openssl")]
pub mod openssl {
pub use ntex_tls::openssl::{SslConnector as Connector, SslFilter};
pub use tls_openssl::ssl::{
Error as SslError, HandshakeError, SslConnector, SslMethod,
};
}
#[cfg(feature = "rustls")]
pub mod rustls {
pub use ntex_tls::rustls::{TlsClientFilter, TlsConnector as Connector};
pub use tls_rust::{pki_types::ServerName, ClientConfig};
}
pub use ntex_net::connect::{connect, Address, Connect, ConnectError, Connector, Resolver};
#[allow(unused_imports)]
#[doc(hidden)]
pub mod net {
pub use ntex_net::*;
}

View file

@ -1,5 +1,9 @@
# Changes
## [0.1.0] - 2024-03-24
## [1.0.1] - 2024-03-24
* Re-add Server::build() method
## [1.0.0] - 2024-03-24
* Release

View file

@ -1,6 +1,6 @@
[package]
name = "ntex-server"
version = "1.0.0"
version = "1.0.1"
authors = ["ntex contributors <team@ntex.rs>"]
description = "Server for ntex framework"
keywords = ["network", "framework", "async", "futures"]

View file

@ -28,6 +28,11 @@ impl<T> Server<T> {
}
}
/// Start streaming server building process
pub fn build() -> crate::net::ServerBuilder {
crate::net::ServerBuilder::default()
}
pub(crate) fn signal(&self, sig: Signal) {
let _ = self.cmd.try_send(ServerCommand::Signal(sig));
}