mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-12 16:16:55 +00:00
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:
@@ -40,5 +40,5 @@ serde_json.workspace = true
|
||||
md-5 = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = { version = "0.5.1", features = ["async", "async_tokio", "tokio"] }
|
||||
#criterion = { version = "0.5.1", features = ["async", "async_tokio", "tokio"] }
|
||||
tokio-test = "0.4"
|
||||
|
||||
Reference in New Issue
Block a user