-
Notifications
You must be signed in to change notification settings - Fork 361
Add an advanced SQS multiple functions with shared data example #720
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
Add an advanced SQS multiple functions with shared data example #720
Conversation
tracing = "0.1.40" | ||
tracing-subscriber = "0.3.17" | ||
|
||
#aws depdencies |
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.
nit: typo
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.
thanks! fixed
[dependencies] | ||
#tracing | ||
tracing = "0.1.40" | ||
tracing-subscriber = "0.3.17" | ||
|
||
#aws dependencies | ||
aws-config = "0.57.1" | ||
aws-sdk-config = "0.35.0" | ||
aws-sdk-sqs = "0.35.0" | ||
|
||
#lambda runtime | ||
lambda_runtime = "0.8.1" | ||
serde_json = "1.0.108" | ||
tokio = { version = "1", features = ["macros"] } |
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.
to fully show the possibilities of the workspace model, you might consider putting these dependencies that are shared between producer and consumer in workspace dependencies.
https://doc.rust-lang.org/nightly/cargo/reference/workspaces.html#the-dependencies-table
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.
yeah, I just wanted to show how to share a struct, so I feel that this change might confuse the user? WDYT? I don't have a strong opinion here so let me know if you want me to make that change :)
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.
i don't feel strongly about it
// create our SQS client | ||
let config = aws_config::from_env().load().await; | ||
|
||
// send our message to SQS | ||
let client = aws_sdk_sqs::Client::new(&config); |
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.
np: comments are a bit mis-aligned here. you say "create our SQS client" when you're just creating the config, then say "send our message" when you create the SQS client.
actually, do you think it makes sense to model the SQS client as shared state here? that'd be best practice.
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.
you're totally right, I've moved it to a shared state!
thanks for the submission! |
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.
Thanks for the example!
Issue: #228
Description of changes:
Add an example using Cargo worskpace feature to:
By submitting this pull request