修订版 | 6b3ba3bcec3eda80fc13f5d94ab9bdb7b53794dc (tree) |
---|---|
时间 | 2022-08-13 02:38:03 |
作者 | Albert Mietus < albert AT mietus DOT nl > |
Commiter | Albert Mietus < albert AT mietus DOT nl > |
asis
@@ -161,9 +161,10 @@ | ||
161 | 161 | |
162 | 162 | (A)Synchronous |
163 | 163 | ~~~~~~~~~~~~~~ |
164 | + | |
164 | 165 | Synchronous messages resembles normal function-calls. Typically a “question” is send, the call awaits the |
165 | -answer-messages, and that answer is returned. This can be seen as a layer on top of the send/receive more fundamental | |
166 | -calls. An famous example is RPC_: the Remote ProcedureCall. | |
166 | +answer-messages, and that answer is returned. This can be seen as a layer on top of the more fundamental send/receive | |
167 | +calls. An famous example is RPC_: the Remote Procedure Call. | |
167 | 168 | |
168 | 169 | Asynchronous messages are more basic: a task send a messages (to somebody else) and continues. That message can be |
169 | 170 | “data”, an “event:, a “commands” or a “query”. Only in the latter case some responds is essental. With async messages, |
@@ -171,19 +172,20 @@ | ||
171 | 172 | |
172 | 173 | As an example: A task can send many queries (and/or other messages) to multiple destinations at once, then go into |
173 | 174 | *listen-mode*, and handle the replies in the order the are received (which can be different then send-order). Typically, |
174 | -this speeds up (wall) time, and is only possible with async messages. Notice: the return messages need to carry an “ID” | |
175 | +this speeds-up (wall) time, and is only possible with async messages. Notice: the return messages need to carry an “ID” | |
175 | 176 | of the initial messages to keep track -- often that is the query itself. |
176 | 177 | |
177 | 178 | |
178 | 179 | (Un)Buffered |
179 | 180 | ~~~~~~~~~~~~ |
180 | -Messages can be *buffered*, or not. It’s not a characteristic of the messages itself, but more about the channel that | |
181 | -transport the messages: How many messages can be stored ‘in’ the channel (often depicted a a queue). When there is no | |
182 | -storage at all the writer and reader needs to rendezvous: send and receive at the same (wall) time. | |
181 | + | |
182 | +Despide it’s is not truly a characteristic of the messages itself, messages can be *buffered*, or not. This about the | |
183 | +channel that transports the messages: How many messages can be stored ‘in’ the channel (often depicted a a queue). When | |
184 | +there is no storage at all, the writer and reader needs to rendezvous: send and receive at the same (wall) time. | |
185 | + | |
186 | +This is not needed when a buffer is available. Depending on the size of the buffer, some messages can be send before | |
187 | +the are picked-up by the receiver. | |
183 | 188 | |BR| |
184 | -This is not needed when a buffer is available; Depending on the size of the buffer, some messages can be send before | |
185 | -the are picked-up by the receiver. | |
186 | - | |
187 | 189 | Note this is always asymmetric: messages need to be send before the can be read. |
188 | 190 | |
189 | 191 | Blocking |
@@ -195,8 +197,7 @@ | ||
195 | 197 | (rendezvous) or a message-buffer is free. |
196 | 198 | |
197 | 199 | When the call is non-blocking, the call will return without waiting and yield a flag whether is was successful or not. |
198 | -|BR| | |
199 | -Typically, the developer will to “cycle” to poll for a profitable call; and let the task do some other/background work | |
200 | +Then, the developer will commonly “cycle” to poll for a profitable call; and let the task do some other/background work | |
200 | 201 | as well. |
201 | 202 | |
202 | 203 |
@@ -204,7 +205,7 @@ | ||
204 | 205 | |
205 | 206 | .. todo:: |
206 | 207 | |
207 | - * Async, buffered, blocking | |
208 | + | |
208 | 209 | * Pipe : kind of data messages |
209 | 210 | |
210 | 211 |