mirror of
https://github.com/actix/actix-website
synced 2025-06-27 23:49:02 +02:00
Architecture diagrams of HttpServer and Connection lifecycle (#148)
* add arch diagrams and menu * fix colors for arch diagrams * refine architecture diagrams, ready for review * capitalize titles and add mmdc instruction * apply code review requested changes * Add links to accept, worker and dispatcher too
This commit is contained in:
committed by
Yuki Okushi
parent
53214f4727
commit
c1a8103cbc
32
static/img/diagrams/http_server.mmd
Normal file
32
static/img/diagrams/http_server.mmd
Normal file
@ -0,0 +1,32 @@
|
||||
sequenceDiagram
|
||||
|
||||
participant HttpServer
|
||||
participant ServerBuilder
|
||||
participant Worker
|
||||
participant StreamNewService
|
||||
participant HttpService
|
||||
participant HttpServiceResponse
|
||||
participant Tokio
|
||||
|
||||
|
||||
HttpServer-->>HttpService: build...
|
||||
HttpServer->>ServerBuilder: listen(addr,Fn->HttpService)
|
||||
ServerBuilder->>StreamNewService: create(addr,Fn->HttpService)
|
||||
HttpServer->>ServerBuilder: start()
|
||||
ServerBuilder->>Worker: start(StreamNewService)
|
||||
|
||||
Worker->>StreamNewService: InternalServiceFactory::create()
|
||||
StreamNewService->>HttpService: new_service()
|
||||
HttpService->>HttpServiceResponse: HttpServiceResponse::new()
|
||||
HttpService->>StreamNewService: HttpServiceResponse as Future
|
||||
StreamNewService->>Worker: StreamService(HttpServiceResponse) as Future
|
||||
Worker-->>Tokio: spawn(StreamService(HttpServiceResponse)).map(Worker))
|
||||
Tokio-->>HttpServiceResponse: poll()
|
||||
HttpServiceResponse-->>Tokio: Ready(Worker(HttpServiceHandler))
|
||||
|
||||
loop Worker process messages
|
||||
Tokio-->>Worker: poll->Pending...
|
||||
activate Worker
|
||||
Note over Worker: pull messages
|
||||
deactivate Worker
|
||||
end
|
Reference in New Issue
Block a user