@@ -24,29 +24,14 @@ extension Lambda {
24
24
self . run ( LambdaClosureWrapper ( closure) )
25
25
}
26
26
27
- /// Run a Lambda defined by implementing the `LambdaCodableHandler` protocol, having `In` and `Out` are `Decodable` and `Encodable` respectively.
28
- ///
29
- /// - note: This is a blocking operation that will run forever, as it's lifecycle is managed by the AWS Lambda Runtime Engine.
30
- public static func run< Handler> ( _ handler: Handler ) where Handler: LambdaCodableHandler {
31
- self . run ( handler as LambdaHandler )
32
- }
33
-
34
27
// for testing
35
28
internal static func run< In: Decodable , Out: Encodable > ( configuration: Configuration = . init( ) , closure: @escaping LambdaCodableClosure < In , Out > ) -> LambdaLifecycleResult {
36
29
return self . run ( handler: LambdaClosureWrapper ( closure) , configuration: configuration)
37
30
}
38
-
39
- // for testing
40
- internal static func run< Handler> ( handler: Handler , configuration: Configuration = . init( ) ) -> LambdaLifecycleResult where Handler: LambdaCodableHandler {
41
- return self . run ( handler: handler as LambdaHandler , configuration: configuration)
42
- }
43
31
}
44
32
45
- /// A result type for a Lambda that returns a generic `Out`, having `Out` extend `Encodable`.
46
- public typealias LambdaCodableResult < Out> = Result < Out , Error >
47
-
48
- /// A callback for a Lambda that returns a `LambdaCodableResult<Out>` result type, having `Out` extend `Encodable`.
49
- public typealias LambdaCodableCallback < Out> = ( LambdaCodableResult < Out > ) -> Void
33
+ /// A callback for a Lambda that returns a `Result<Out, Error>` result type, having `Out` extend `Encodable`.
34
+ public typealias LambdaCodableCallback < Out> = ( Result < Out , Error > ) -> Void
50
35
51
36
/// A processing closure for a Lambda that takes an `In` and returns an `Out` via `LambdaCodableCallback<Out>` asynchronously,
52
37
/// having `In` and `Out` extending `Decodable` and `Encodable` respectively.
0 commit comments