Crates.io | mu_alb |
lib.rs | mu_alb |
version | 0.2.0 |
source | src |
created_at | 2021-05-11 03:47:07.776539 |
updated_at | 2021-05-11 03:47:07.776539 |
description | Alternative AWS Lambda Runtime designed to listen ALB HTTP requests |
homepage | |
repository | https://github.com/miere/mu-rs |
max_upload_size | |
id | 395911 |
size | 18,521 |
A minimalistic AWS Lambda runtime. It was written based on the official lambda_runtime
and
was designed to be used along with the trustworthy aws_lambda_event
crate.
The official AWS Lambda Runtime is awesome, very well crafted and has battle-tested by several developers in the past few years. It is known, though, that it has a slow development pace - where PR and tickets being left months until receive proper attention. The so waited release of the 0.3.0 version also introduced extra complexities on its default API, making it more verbose and less developer friendly.
The main goal of μ-rs is to provide an easy-to-use api for AWS Serverless Developers, leveraging enterprise-grade semantics in the powerful Rust ecosystem.
Disclaimer: This crate has been developed on the best effort from its authors. Although quite useful as being presented, it still on its early stages of development.
Although initially this library used to depend on the (official) lambda_runtime
crate, ever
since the 0.2.0 it's not being the case anymore. The current codebase was deeply inspired on
the official one though, having its code base deeply simplified. It is still possible to
see a resemblances between these two crates, though. In the case this library proves useful,
it can be back-ported to the upstream repository.
Set up the dependency.
[dependencies]
mu="0.2.0"
Start listen to events on your Lambda functions.
// Sample lambda function that listen for SQS events.
use aws_lambda_events::event::sqs::SqsEvent;
use mu;
#[tokio::main]
async fn main() -> mu::RuntimeResult {
mu::listen_events(|sqs_events, ctx| {
handle_sqs_messages(sqs_events)
}).await
}
async fn handle_sqs_messages(sqs_events: SqsEvent) -> Result<(), mu::Error> {
println!("Received {} events", sqs_events.records.len());
Ok(())
}
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
A reproducible test case or series of steps
The version of our code being used
Any modifications you've made relevant to the bug
Anything unusual about your environment or deployment
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
To send us a pull request, please:
GitHub provides additional document on forking a repository and creating a pull request.
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
This is release under the Apache License 2 terms.