You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Initializes an instance given a decoder, and a handler with a `Void` output.
88
+
/// - Parameters:
89
+
/// - decoder: The decoder object that will be used to decode the received `ByteBuffer` event into the generic `Event` type served to the `handler`. By default, a JSONDecoder is used.
90
+
/// - handler: The handler object.
91
+
publicinit(
92
+
decoder:JSONDecoder=JSONDecoder(),
93
+
handler:sending Handler
94
+
)
95
+
where
96
+
Output ==Void,
97
+
Handler.Output ==Void,
98
+
Decoder ==LambdaJSONEventDecoder,
99
+
Encoder ==VoidEncoder
100
+
{
101
+
self.init(
102
+
decoder:LambdaJSONEventDecoder(decoder),
103
+
handler: handler
104
+
)
105
+
}
86
106
}
107
+
87
108
@available(LambdaSwift 2.0,*)
88
109
extensionLambdaResponseStreamWriter{
89
110
/// Writes the HTTP status code and headers to the response stream.
@@ -161,12 +182,41 @@ extension LambdaRuntime {
161
182
self.init(handler: handler, logger: logger)
162
183
}
163
184
164
-
/// Initialize an instance directly with a `LambdaHandler`.
185
+
/// Initialize an instance directly with a `LambdaHandler`, when `Event` is `Decodable` and `Output` is `Void`.
186
+
/// - Parameters:
187
+
/// - decoder: The decoder object that will be used to decode the incoming `ByteBuffer` event into the generic `Event` type. `JSONDecoder()` used as default.
188
+
/// - logger: The logger to use for the runtime. Defaults to a logger with label "LambdaRuntime".
189
+
/// - lambdaHandler: A type that conforms to the `LambdaHandler` protocol, whose `Event` is `Decodable` and `Output` is `Void`
/// Initialize an instance directly with a `LambdaHandler`, when `Event` is `Decodable` and `Output` is `Encodable`.
165
215
/// - Parameters:
166
216
/// - decoder: The decoder object that will be used to decode the incoming `ByteBuffer` event into the generic `Event` type. `JSONDecoder()` used as default.
167
217
/// - encoder: The encoder object that will be used to encode the generic `Output` into a `ByteBuffer`. `JSONEncoder()` used as default.
168
218
/// - logger: The logger to use for the runtime. Defaults to a logger with label "LambdaRuntime".
169
-
/// - lambdaHandler: A type that conforms to the `LambdaHandler` protocol, whose `Event` and `Output` types must be `Decodable`/`Encodable`
219
+
/// - lambdaHandler: A type that conforms to the `LambdaHandler` protocol, whose `Event` is `Decodable` and `Output` is `Encodable`
0 commit comments