Refactor(server): Encapsulate service creation within connection handler

Move the construction of the hybrid service stack, including all middleware and the RPC service, from the main `run` function into the `process_connection` function.

This change ensures that each incoming connection gets its own isolated service instance. This improves modularity by making the connection handling logic more self-contained and simplifies the main server loop.

Key changes:
- The `hybrid_service` and `rpc_service` are now created inside `process_connection`.
- The `run` function's responsibility is reduced to accepting TCP connections and spawning tasks for `process_connection`.
This commit is contained in:
houseme
2025-07-04 01:33:16 +08:00
parent caa3564439
commit 96d22c3276
5 changed files with 178 additions and 338 deletions
-2
View File
@@ -69,7 +69,6 @@ percent-encoding = { workspace = true }
pin-project-lite.workspace = true
reqwest = { workspace = true }
rustls.workspace = true
rustls-pki-types = { workspace = true }
rust-embed = { workspace = true, features = ["interpolate-folder-path"] }
s3s.workspace = true
serde.workspace = true
@@ -102,7 +101,6 @@ tower-http = { workspace = true, features = [
urlencoding = { workspace = true }
uuid = { workspace = true }
zip = { workspace = true }
x509-parser = { workspace = true, features = ["verify", "validate"] }
[target.'cfg(target_os = "linux")'.dependencies]