-
Use Swift on AWS Lambda with Xcode
Serverless functions are increasingly becoming popular for running event-driven or otherwise ad-hoc compute tasks in the cloud, allowing developers to more easily scale and control compute costs. Discover how to use the new Swift AWS Lambda Runtime package to build serverless functions in Swift, debug locally using Xcode, and deploy these functions to the AWS Lambda platform. We'll show you how Swift shines on AWS Lambda thanks to its low memory footprint, deterministic performance, and quick start time.
Recursos
Vídeos relacionados
WWDC22
WWDC21
-
Buscar neste vídeo...
-
-
2:02 - Closure based Lambda function
import AWSLambdaRuntime Lambda.run { (_, name: String, callback) in callback(.success("Hello, \(name)!")) } -
2:33 - EventLoop based Lambda function
import AWSLambdaRuntime import NIO struct Handler: EventLoopLambdaHandler { typealias In = String typealias Out = String func handle(context: Lambda.Context, event: String) -> EventLoopFuture<String> { context.eventLoop.makeSucceededFuture("Hello, \(event)!") } } Lambda.run(Handler()) -
2:59 - Closure and Codable based Lambda function
import AWSLambdaRuntime struct Request: Codable { let name: String let password: String } struct Response: Codable { let message: String } Lambda.run { (_, request: Request, callback) in callback(.success(Response(message: "Hello, \(request.name)!"))) }
-