Skip to content
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

chore(sdk): update queue.push() to use variadic parameter for messages #3746

Merged
merged 11 commits into from
Aug 17, 2023

Conversation

garysassano
Copy link
Collaborator

Closes #2278

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

@garysassano garysassano requested a review from a team as a code owner August 8, 2023 23:29
@garysassano garysassano changed the title chore(sdk): update queue.push to use variadic argument for messages chore(sdk): update queue.push to use variadic parameter for messages Aug 8, 2023
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 10, 2023
libs/wingsdk/src/target-sim/queue.inflight.ts Outdated Show resolved Hide resolved
libs/wingsdk/src/cloud/queue.ts Outdated Show resolved Hide resolved
@garysassano
Copy link
Collaborator Author

@Chriscbr I was wondering if it wouldn't be better to preserve the push method while introducing an additional pushBatch method that makes use of the variadic parameter. This new method could leverage the SendMessageBatch API for AWS targets.

@Chriscbr
Copy link
Contributor

@garysassano What would the pros and cons be?

@garysassano garysassano changed the title chore(sdk): update queue.push to use variadic parameter for messages chore(sdk): update queue.push() to use variadic parameter for messages Aug 15, 2023
@garysassano garysassano force-pushed the queue-push-variadic branch 3 times, most recently from 05a4459 to 1d6e741 Compare August 15, 2023 05:03
@garysassano
Copy link
Collaborator Author

@Chriscbr Not many things come to my mind, but probably:

  • Pro: you can make a single API call to AWS instead of multiple ones.
  • Con: if you fail to push a message, you still get a HTTP 200 returned because the batch operation is considered successful even if some operations fail, so you need to check for batch errors.

@garysassano
Copy link
Collaborator Author

I think it's fine to just keep a single method for now.

@Chriscbr Chriscbr removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 15, 2023
@mergify
Copy link
Contributor

mergify bot commented Aug 15, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Signed-off-by: monada-bot[bot] <[email protected]>
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 15, 2023
@Chriscbr Chriscbr removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 17, 2023
@mergify
Copy link
Contributor

mergify bot commented Aug 17, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

mergify bot added a commit that referenced this pull request Aug 17, 2023
@mergify mergify bot merged commit 37f65dc into main Aug 17, 2023
11 checks passed
@mergify mergify bot deleted the queue-push-variadic branch August 17, 2023 13:25
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.25.18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cloud.Queue - push batch of items
3 participants