-
Notifications
You must be signed in to change notification settings - Fork 256
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
[Deployments]: AWS Lambdas #1551
Comments
Pulling out a summary of this idea from a Discord discussion. The proposal would be to accept user code and execute it on the Shuttle runtime in a Function-as-a-Service manner - made famous by AWS Lambda. Benefits to the user
Benefits to Shuttle
Below is an example of what user code to register a Shuttle FaaS might look like: #[derive(serde::Serialize)]
pub struct CalculationResult {
z: f64,
}
#[derive(serde::Deserialize)]
pub struct CalculationInput {
x: f64,
y: f64,
}
pub enum Error {
InternalError,
}
// More hands-on way of exposing a lambda-like endpoint
#[shuttle_runtime::faas_post("/mutliply")]
pub async fn multiply(input: CalculationInput) -> Result<CalculationResult, Error> {
Ok(CalculationResult {
z: input.x * input.y,
})
}
// Could it be simplified such that someone would only need to do the below? Shuttle
// would then generate the JSON types
#[shuttle_runtime::faas_post("/multiply_simple")]
pub async fn multiply_simple(x: f64, y: f64) -> f64 {
x * y
} Things to think about:
|
Adding some more benefits that a FaaS model might bring to both users and the platform, largely due to the request-scoped nature of FaaS:
|
Deploy AWS Lambdas using Shuttle
This issue is a part of the Product Feature Poll (all issues). React with 👍 if you want this feature. Comment if you have suggestions related to this feature.
The text was updated successfully, but these errors were encountered: