You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using Lacinia subscriptions to handle AWS event stream responses, to stream those events back to the client.
It seems that the values passed to the subscription callback function are not sent to the WebSocket in the same order that the callback is called. I can log the order on the server, and then by observing the WebSocket messages I can see that they're being sent in a different order.
Here's a stripped down version of the subscription handler:
It doesn't seem to be documented anywhere that Lacinia subscriptions don't provide ordering guarantees. For now I've managed to work around this by providing an index in the responses and re-ordering on the client.
The text was updated successfully, but these errors were encountered:
I'm surprised that order is not maintained, I'll have to look over the code and the guarantees made by core.async. How close are the events from AWS coming in?
I've been testing this with the InvokeModelWithResponseStream operation on the AWS Bedrock API. So the events are coming in milliseconds apart. The rate is not constant and most events do arrive on the client in the correct order.
I can provide more surrounding code to try and get a minimal reproduction, if it helps.
I've been using Lacinia subscriptions to handle AWS event stream responses, to stream those events back to the client.
It seems that the values passed to the subscription callback function are not sent to the WebSocket in the same order that the callback is called. I can log the order on the server, and then by observing the WebSocket messages I can see that they're being sent in a different order.
Here's a stripped down version of the subscription handler:
It doesn't seem to be documented anywhere that Lacinia subscriptions don't provide ordering guarantees. For now I've managed to work around this by providing an index in the responses and re-ordering on the client.
The text was updated successfully, but these errors were encountered: