1
0
mirror of https://github.com/actix/actix-website synced 2024-11-27 18:12:57 +01:00
actix-website/static/img/diagrams/connection_worker.mmd
Maxim Vorobjov c1a8103cbc 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
2020-01-28 20:36:35 +09:00

35 lines
973 B
Plaintext

sequenceDiagram
participant ServerBuilder
participant WorkerClient
participant Worker
participant StreamService
participant HttpServiceHandler
participant Tokio
ServerBuilder-->>Tokio: spawn(Worker)
Tokio-->>Worker: poll()
alt WorkerState::Available
loop
Worker->>WorkerClient: rx.poll_next()
WorkerClient->>Worker: WorkerCommand(Conn)
Worker->>Worker: check_readiness()
alt check_readiness() -> Ok(true)
Note over Worker,StreamService: Worker::services[Conn.token]
Worker-->>StreamService: call(ServerMessage::Connect(stream))
StreamService->>HttpServiceHandler: call(stream)
HttpServiceHandler->>StreamService: HttpServiceHandlerResponse as Future
StreamService->>Tokio: spawn(HttpServiceHandlerResponse)
else check_readiness() -> Ok(false)
Worker-->>Worker: WorkerState::Unavailable
else check_readiness() -> Err(token,idx)
Worker-->>Worker: WorkerState::Restarting
end
end
end
Note over HttpServiceHandler: process connection