Rust library lambda_sqs

Crates.io MIT licensed Build Status Rust 1.46+ FOSSA Status Docs BuyMeaCoffee GitHubSponsors

Specialised lambda_runtime to accept and process events from SQS.

SQS Events

SQS dispatches events to the a lambda function in batches (often, it seems to my surprise). This crate provides a lambda_runtime implementation which expects to receive a batch of messages in the [SqsEvent] type and provides a method to transform the batch of events to a vector of your Struct.

Example

```rust use yourmodule::YourStruct; use lambdasqs::{handlerfn, Context, Error}; use lambdasqs::SqsEvent;

[tokio::main]

async fn main() -> Result<(), Error> { lambdasqs::run(handlerfn(myhandler)).await?; Ok(()) } pub async fn myhandler(e: SqsEvent, c: Context) -> Result<(), Error> { let events: Vec = e.into_t();

// Process events

Ok(())

} ```

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.