Tom Doron 39b0140b80 http client event loop cleanup (#3)
motivation: EventLoop is also an EventLoopGroup, no need in wrapping

changes: remove SingleEventLoopGroup wrapper, use EventLoop directly
2018-11-15 13:49:32 -08:00
2018-11-13 17:48:44 -08:00
2018-11-15 13:49:32 -08:00
2018-11-13 17:48:44 -08:00
2018-11-13 17:48:44 -08:00
2018-11-13 17:48:44 -08:00
2018-11-13 17:48:44 -08:00
2018-11-13 17:48:44 -08:00
2018-11-13 17:48:44 -08:00
2018-11-13 17:48:44 -08:00

Swift AWS Lambda

This library is designed to allow writing AWS Lambdas using the Swift programming language.

Getting started

  1. Create a SwiftPM project and pull SwiftAwsLambda as dependency into your project
import PackageDescription

let package = Package(
    name: "my-lambda",
    products: [
        .executable(name: "MyLambda", targets: ["MyLambda"]),
    ],
    dependencies: [
        .package(url: "https://github.com/swift-server/swift-aws-lambda.git", .upToNextMajor(from: "0.1.0")),
    ],
    targets: [PackageDescription.Target] = [
        .target(name: "MyLambda", dependencies: ["SwiftAwsLambda"]),    
    ]
)
  1. Create a main.swift and implement you lambda. typically a lambda is implemented as a closure. For example, a simple lambda for a closure that receives a string payload and replies with the reverse version:
import SwiftAwsLambda

_ = Lambda.run { (context: LambdaContext, payload: String, callback: LambdaStringCallback) in
    callback(.success(String(payload.reversed())))
}

note you can implement 3 types of lambdas:

  1. [UInt8] (byte array) based (default): see SwiftAwsLambdaExample
  2. String based: see SwiftAwsLambdaStringExample
  3. Codable based: see SwiftAwsLambdaCodableExample

Architecture

TODO

S
Description
Swift implementation of AWS Lambda Runtime
Readme
32 MiB
Languages
Cython 54.9%
Swift 40.8%
Shell 4.2%
Makefile 0.1%