Skip to content

Commit 7c74606

Browse files
committed
Diagram: show how doc transitions to [*] busy then [𝒏] idle state
1 parent facf5b4 commit 7c74606

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Execution of a Python code snippet: `print("hello")`
7575
```mermaid
7676
sequenceDiagram
7777
actor Frontend; participant Shared Document; actor Server; participant ExecutionStack; actor Kernel
78+
Frontend->>Shared Document: [*] busy
7879
Frontend->>+Server: POST /api/kernels/<id>/execute
7980
Server->>+ExecutionStack: put() request into queue
8081
ExecutionStack->>Kernel: Execute request msg
@@ -92,12 +93,15 @@ sequenceDiagram
9293
ExecutionStack-->>Server: null
9394
Server-->>-Frontend: Request status 202
9495
end
95-
Kernel-->>ExecutionStack: Execution reply
96+
Kernel-->>Server: Execution reply
97+
Server->>Shared Document: [𝒏] idle
98+
Server-->>ExecutionStack: execution_count, status, outputs
99+
Shared Document->>Frontend: [𝒏] idle
96100
deactivate Kernel
97101
Frontend->>+Server: GET /api/kernels/<id>/requests/<uid>
98102
Server->>ExecutionStack: get() task result
99-
ExecutionStack-->>Server: Result
100-
Server-->>-Frontend: Status 200 & result
103+
ExecutionStack-->>Server: execution_count, status, outputs
104+
Server-->>-Frontend: Status 200 & { execution_count, status, outputs }
101105
```
102106

103107
### With input case
@@ -107,6 +111,7 @@ Execution of a Python code snippet: `input("Age:")`
107111
```mermaid
108112
sequenceDiagram
109113
actor Frontend; participant Shared Document; actor Server; participant ExecutionStack; actor Kernel
114+
Frontend->>Shared Document: [*] busy
110115
Frontend->>+Server: POST /api/kernels/<id>/execute
111116
Server->>+ExecutionStack: put() request into queue
112117
ExecutionStack->>Kernel: Execute request msg
@@ -138,12 +143,15 @@ sequenceDiagram
138143
ExecutionStack-->>Server: null
139144
Server-->>-Frontend: Request status 202
140145
end
141-
Kernel-->>ExecutionStack: Execution reply
146+
Kernel-->>Server: Execution reply
147+
Server->>Shared Document: [𝒏] idle
148+
Server-->>ExecutionStack: execution_count, status, outputs
149+
Shared Document->>Frontend: [𝒏] idle
142150
deactivate Kernel
143151
Frontend->>+Server: GET /api/kernels/<id>/requests/<uid>
144152
Server->>ExecutionStack: get() task result
145-
ExecutionStack-->>Server: Result
146-
Server-->>-Frontend: Status 200 & result
153+
ExecutionStack-->>Server: execution_count, status, outputs
154+
Server-->>-Frontend: Status 200 & { execution_count, status, outputs }
147155
```
148156

149157
> \[!NOTE\]

0 commit comments

Comments
 (0)