-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sdk): cloud.Queue is not FIFO by default #4173
Conversation
Console preview environment is available at https://wing-console-pr-4173.fly.dev 🚀 Updated (UTC): 2023-09-13 15:39 |
Signed-off-by: monada-bot[bot] <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind adding a quick snippet to https://www.winglang.io/docs/standard-library/cloud/queue about queues not being FIFO?
I was going to open a PR but wonder if we can just sneak it in here? I dont mind doing it separately either.
@hasanaburayyan good idea - done 👍 |
Signed-off-by: monada-bot[bot] <[email protected]>
Wouldn't it be better to add this option already? So we can reuse existing code instead of eliminating it. |
Thanks for contributing, @Chriscbr! This PR will now be added to the merge queue, or immediately merged if |
Congrats! 🚀 This was released in Wing 0.30.7. |
Related to #3897
We have a flakey test in our CI that validates part of the functionality of
cloud.Queue
. It turns out, our test was assuming that the queue messages are received in FIFO order (first-in-first-out), which wasn't something we meant to guarantee (see the original issue aboutqueue.pop()
here). This PR fixes the test, and updates the simulator implementation to reflect the fact that messages can be received out of order.(Why not FIFO by default? For many distributed apps, the exact order of messages isn't critical, and relaxing this constraint makes it easier to handle higher throughputs of messages. That said, adding a
fifo
option tocloud.Queue
would be reasonable as a future enhancement)Checklist
pr/e2e-full
label if this feature requires end-to-end testingBy submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.