From 9c44f375f2537fa0277a6c6831c63c1c1cfc5373 Mon Sep 17 00:00:00 2001 From: Joachim Van Herwegen Date: Mon, 1 Jul 2024 09:28:48 +0200 Subject: [PATCH] docs: Update server architecture documentation --- .../architecture/features/initialization.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/documentation/markdown/architecture/features/initialization.md b/documentation/markdown/architecture/features/initialization.md index 6ba829f80..59f5ca19b 100644 --- a/documentation/markdown/architecture/features/initialization.md +++ b/documentation/markdown/architecture/features/initialization.md @@ -108,32 +108,33 @@ to add any custom initializers that need to run. The `ServerInitializer` is the initializer that finally starts up the server by listening to the relevant port, once all the initialization described above is finished. -It takes as input 2 components: a `HttpServerFactory` and a `ServerListener`. +To do this it makes use of an `HttpServerFactory`. ```mermaid flowchart TD ServerInitializer("ServerInitializer
ServerInitializer") - ServerInitializer --> ServerInitializerArgs + ServerInitializer --> ServerFactory("ServerFactory
BaseServerFactory") + ServerFactory --> ServerConfigurator("ServerConfigurator
ParallelHandler") + ServerConfigurator --> ServerConfiguratorArgs - subgraph ServerInitializerArgs[" "] + subgraph ServerConfiguratorArgs[" "] direction LR - ServerFactory("ServerFactory
BaseServerFactory") - ServerListener("ServerListener
ParallelHandler") + HandlerServerConfigurator("HandlerServerConfigurator
HandlerServerConfigurator") + WebSocketServerConfigurator("WebSocketServerConfigurator
WebSocketServerConfigurator") end - ServerListener --> HandlerServerListener("HandlerServerListener
HandlerServerListener") - - HandlerServerListener --> HttpHandler("HttpHandler
HttpHandler") + HandlerServerConfigurator --> HttpHandler("HttpHandler
HttpHandler") + WebSocketServerConfigurator --> WebSocketHandler("WebSocketHandler
WebSocketHandler") ``` The `HttpServerFactory` is responsible for starting a server on a given port. Depending on the configuration this can be an HTTP or an HTTPS server. The created server emits events when it receives requests. -A `ServerListener` is a class that takes the created server as input and attaches a listener to interpret events. -One listener that is always used is the `urn:solid-server:default:HandlerServerListener`, -which calls an `HttpHandler` [to resolve HTTP requests](http-handler.md). - -Sometimes it is necessary to add additional listeners, -these can then be added to the `urn:solid-server:default:ServerListener` as it is a `ParallellHandler`. -An example of this is when WebSockets are used [to handle notifications](notifications.md). +Any requests it receives, it sends to its `ServerConfigurator`, +which handles the request as needed. +This is a `ParallelHandler`, supporting two kinds of requests: +HTTP requests go through a configurator that sends those +to an `HttpHandler` [to resolve HTTP requests](http-handler.md). +In case WebSockets are enabled [to handle notifications](notifications.md), +these are handled by the `WebSocketHandler`.