1
- /*
1
+ /*
2
2
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License").
@@ -29,8 +29,11 @@ public class HandlerWrapper : IDisposable
29
29
private static readonly InvocationResponse EmptyInvocationResponse =
30
30
new InvocationResponse ( new MemoryStream ( 0 ) , false ) ;
31
31
32
- private MemoryStream OutputStream = new MemoryStream ( ) ;
32
+ private readonly MemoryStream OutputStream = new MemoryStream ( ) ;
33
33
34
+ /// <summary>
35
+ /// The handler that will be called for each event.
36
+ /// </summary>
34
37
public LambdaBootstrapHandler Handler { get ; private set ; }
35
38
36
39
private HandlerWrapper ( LambdaBootstrapHandler handler )
@@ -163,7 +166,7 @@ public static HandlerWrapper GetHandlerWrapper<TInput>(Func<TInput, ILambdaConte
163
166
/// <summary>
164
167
/// Get a HandlerWrapper that will call the given method on function invocation.
165
168
/// Note that you may have to cast your handler to its specific type to help the compiler.
166
- /// Example handler signature: Task<Stream > Handler()
169
+ /// Example handler signature: Task<Stream > Handler()
167
170
/// </summary>
168
171
/// <param name="handler">Func called for each invocation of the Lambda function.</param>
169
172
/// <returns>A HandlerWrapper</returns>
@@ -178,7 +181,7 @@ public static HandlerWrapper GetHandlerWrapper(Func<Task<Stream>> handler)
178
181
/// <summary>
179
182
/// Get a HandlerWrapper that will call the given method on function invocation.
180
183
/// Note that you may have to cast your handler to its specific type to help the compiler.
181
- /// Example handler signature: Task<Stream > Handler(Stream)
184
+ /// Example handler signature: Task<Stream > Handler(Stream)
182
185
/// </summary>
183
186
/// <param name="handler">Func called for each invocation of the Lambda function.</param>
184
187
/// <returns>A HandlerWrapper</returns>
@@ -193,7 +196,7 @@ public static HandlerWrapper GetHandlerWrapper(Func<Stream, Task<Stream>> handle
193
196
/// <summary>
194
197
/// Get a HandlerWrapper that will call the given method on function invocation.
195
198
/// Note that you may have to cast your handler to its specific type to help the compiler.
196
- /// Example handler signature: Task<Stream > Handler(PocoIn)
199
+ /// Example handler signature: Task<Stream > Handler(PocoIn)
197
200
/// </summary>
198
201
/// <param name="handler">Func called for each invocation of the Lambda function.</param>
199
202
/// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -210,7 +213,7 @@ public static HandlerWrapper GetHandlerWrapper<TInput>(Func<TInput, Task<Stream>
210
213
/// <summary>
211
214
/// Get a HandlerWrapper that will call the given method on function invocation.
212
215
/// Note that you may have to cast your handler to its specific type to help the compiler.
213
- /// Example handler signature: Task<Stream > Handler(ILambdaContext)
216
+ /// Example handler signature: Task<Stream > Handler(ILambdaContext)
214
217
/// </summary>
215
218
/// <param name="handler">Func called for each invocation of the Lambda function.</param>
216
219
/// <returns>A HandlerWrapper</returns>
@@ -225,7 +228,7 @@ public static HandlerWrapper GetHandlerWrapper(Func<ILambdaContext, Task<Stream>
225
228
/// <summary>
226
229
/// Get a HandlerWrapper that will call the given method on function invocation.
227
230
/// Note that you may have to cast your handler to its specific type to help the compiler.
228
- /// Example handler signature: Task<Stream > Handler(Stream, ILambdaContext)
231
+ /// Example handler signature: Task<Stream > Handler(Stream, ILambdaContext)
229
232
/// </summary>
230
233
/// <param name="handler">Func called for each invocation of the Lambda function.</param>
231
234
/// <returns>A HandlerWrapper</returns>
@@ -240,7 +243,7 @@ public static HandlerWrapper GetHandlerWrapper(Func<Stream, ILambdaContext, Task
240
243
/// <summary>
241
244
/// Get a HandlerWrapper that will call the given method on function invocation.
242
245
/// Note that you may have to cast your handler to its specific type to help the compiler.
243
- /// Example handler signature: Task<Stream > Handler(PocoIn, ILambdaContext)
246
+ /// Example handler signature: Task<Stream > Handler(PocoIn, ILambdaContext)
244
247
/// </summary>
245
248
/// <param name="handler">Func called for each invocation of the Lambda function.</param>
246
249
/// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -257,7 +260,7 @@ public static HandlerWrapper GetHandlerWrapper<TInput>(Func<TInput, ILambdaConte
257
260
/// <summary>
258
261
/// Get a HandlerWrapper that will call the given method on function invocation.
259
262
/// Note that you may have to cast your handler to its specific type to help the compiler.
260
- /// Example handler signature: Task<PocoOut > Handler()
263
+ /// Example handler signature: Task<PocoOut > Handler()
261
264
/// </summary>
262
265
/// <param name="handler">Func called for each invocation of the Lambda function.</param>
263
266
/// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -279,7 +282,7 @@ public static HandlerWrapper GetHandlerWrapper<TOutput>(Func<Task<TOutput>> hand
279
282
/// <summary>
280
283
/// Get a HandlerWrapper that will call the given method on function invocation.
281
284
/// Note that you may have to cast your handler to its specific type to help the compiler.
282
- /// Example handler signature: Task<PocoOut > Handler(Stream)
285
+ /// Example handler signature: Task<PocoOut > Handler(Stream)
283
286
/// </summary>
284
287
/// <param name="handler">Func called for each invocation of the Lambda function.</param>
285
288
/// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -301,7 +304,7 @@ public static HandlerWrapper GetHandlerWrapper<TOutput>(Func<Stream, Task<TOutpu
301
304
/// <summary>
302
305
/// Get a HandlerWrapper that will call the given method on function invocation.
303
306
/// Note that you may have to cast your handler to its specific type to help the compiler.
304
- /// Example handler signature: Task<PocoOut > Handler(PocoIn)
307
+ /// Example handler signature: Task<PocoOut > Handler(PocoIn)
305
308
/// </summary>
306
309
/// <param name="handler">Func called for each invocation of the Lambda function.</param>
307
310
/// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -324,7 +327,7 @@ public static HandlerWrapper GetHandlerWrapper<TInput, TOutput>(Func<TInput, Tas
324
327
/// <summary>
325
328
/// Get a HandlerWrapper that will call the given method on function invocation.
326
329
/// Note that you may have to cast your handler to its specific type to help the compiler.
327
- /// Example handler signature: Task<PocoOut > Handler(ILambdaContext)
330
+ /// Example handler signature: Task<PocoOut > Handler(ILambdaContext)
328
331
/// </summary>
329
332
/// <param name="handler">Func called for each invocation of the Lambda function.</param>
330
333
/// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -346,7 +349,7 @@ public static HandlerWrapper GetHandlerWrapper<TOutput>(Func<ILambdaContext, Tas
346
349
/// <summary>
347
350
/// Get a HandlerWrapper that will call the given method on function invocation.
348
351
/// Note that you may have to cast your handler to its specific type to help the compiler.
349
- /// Example handler signature: Task<PocoOut > Handler(Stream, ILambdaContext)
352
+ /// Example handler signature: Task<PocoOut > Handler(Stream, ILambdaContext)
350
353
/// </summary>
351
354
/// <param name="handler">Func called for each invocation of the Lambda function.</param>
352
355
/// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -368,7 +371,7 @@ public static HandlerWrapper GetHandlerWrapper<TOutput>(Func<Stream, ILambdaCont
368
371
/// <summary>
369
372
/// Get a HandlerWrapper that will call the given method on function invocation.
370
373
/// Note that you may have to cast your handler to its specific type to help the compiler.
371
- /// Example handler signature: Task<PocoOut > Handler(PocoIn, ILambdaContext)
374
+ /// Example handler signature: Task<PocoOut > Handler(PocoIn, ILambdaContext)
372
375
/// </summary>
373
376
/// <param name="handler">Func called for each invocation of the Lambda function.</param>
374
377
/// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -719,6 +722,9 @@ public static HandlerWrapper GetHandlerWrapper<TInput, TOutput>(Func<TInput, ILa
719
722
#region IDisposable Support
720
723
private bool disposedValue = false ; // To detect redundant calls
721
724
725
+ /// <summary>
726
+ /// Dispose the HandlerWrapper
727
+ /// </summary>
722
728
protected virtual void Dispose ( bool disposing )
723
729
{
724
730
if ( ! disposedValue )
@@ -732,6 +738,9 @@ protected virtual void Dispose(bool disposing)
732
738
}
733
739
}
734
740
741
+ /// <summary>
742
+ /// Dispose the HandlerWrapper
743
+ /// </summary>
735
744
public void Dispose ( )
736
745
{
737
746
Dispose ( true ) ;
0 commit comments