mirror of
https://github.com/swift-server/swift-aws-lambda-runtime.git
synced 2026-06-02 07:27:33 +00:00
motivation: benchmark for comparison of warm/cold runs changes: * refactor configuration * add mock server that can be used by perf tests * add simple perf test script * change redundant classes to structs, make remaining classes final * make offloading opt-in * safer locking * fix format
22 lines
768 B
Swift
22 lines
768 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the SwiftAwsLambda open source project
|
|
//
|
|
// Copyright (c) 2017-2018 Apple Inc. and the SwiftAwsLambda project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of SwiftAwsLambda project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
import SwiftAwsLambda
|
|
|
|
// in this example we are receiving and responding with strings
|
|
Lambda.run { (_, payload: String, callback) in
|
|
// as an example, respond with the reverse the input payload
|
|
callback(.success(String(payload.reversed())))
|
|
}
|