is socket data ordered sequential using receiving async client? #865
-
hello, miguel. I'm receive socket data using AsyncClient. is it guarantee the sequence of data? always I really thank you about your support. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Incoming WebSocket events are dispatched to your application in the order they are received, which is also the order in which they were sent. One possible complication is that sometimes you may end up having two or more handlers running concurrently. For example, let's say event A is dispatched to your application, and while this event handler is running, event B arrives. With the default configuration, event B will be dispatched, even though the handler for A hasn't completed. If you want the event handlers to be serialized, set |
Beta Was this translation helpful? Give feedback.
Incoming WebSocket events are dispatched to your application in the order they are received, which is also the order in which they were sent. One possible complication is that sometimes you may end up having two or more handlers running concurrently.
For example, let's say event A is dispatched to your application, and while this event handler is running, event B arrives. With the default configuration, event B will be dispatched, even though the handler for A hasn't completed. If you want the event handlers to be serialized, set
async_workers=False
when you create your server. Then in the A and B example, B will be received, but it will wait in a queue until the handler for A returns, an…