1- /*
1+ /*
22 * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License").
@@ -29,8 +29,11 @@ public class HandlerWrapper : IDisposable
2929 private static readonly InvocationResponse EmptyInvocationResponse =
3030 new InvocationResponse ( new MemoryStream ( 0 ) , false ) ;
3131
32- private MemoryStream OutputStream = new MemoryStream ( ) ;
32+ private readonly MemoryStream OutputStream = new MemoryStream ( ) ;
3333
34+ /// <summary>
35+ /// The handler that will be called for each event.
36+ /// </summary>
3437 public LambdaBootstrapHandler Handler { get ; private set ; }
3538
3639 private HandlerWrapper ( LambdaBootstrapHandler handler )
@@ -163,7 +166,7 @@ public static HandlerWrapper GetHandlerWrapper<TInput>(Func<TInput, ILambdaConte
163166 /// <summary>
164167 /// Get a HandlerWrapper that will call the given method on function invocation.
165168 /// 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()
167170 /// </summary>
168171 /// <param name="handler">Func called for each invocation of the Lambda function.</param>
169172 /// <returns>A HandlerWrapper</returns>
@@ -178,7 +181,7 @@ public static HandlerWrapper GetHandlerWrapper(Func<Task<Stream>> handler)
178181 /// <summary>
179182 /// Get a HandlerWrapper that will call the given method on function invocation.
180183 /// 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)
182185 /// </summary>
183186 /// <param name="handler">Func called for each invocation of the Lambda function.</param>
184187 /// <returns>A HandlerWrapper</returns>
@@ -193,7 +196,7 @@ public static HandlerWrapper GetHandlerWrapper(Func<Stream, Task<Stream>> handle
193196 /// <summary>
194197 /// Get a HandlerWrapper that will call the given method on function invocation.
195198 /// 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)
197200 /// </summary>
198201 /// <param name="handler">Func called for each invocation of the Lambda function.</param>
199202 /// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -210,7 +213,7 @@ public static HandlerWrapper GetHandlerWrapper<TInput>(Func<TInput, Task<Stream>
210213 /// <summary>
211214 /// Get a HandlerWrapper that will call the given method on function invocation.
212215 /// 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)
214217 /// </summary>
215218 /// <param name="handler">Func called for each invocation of the Lambda function.</param>
216219 /// <returns>A HandlerWrapper</returns>
@@ -225,7 +228,7 @@ public static HandlerWrapper GetHandlerWrapper(Func<ILambdaContext, Task<Stream>
225228 /// <summary>
226229 /// Get a HandlerWrapper that will call the given method on function invocation.
227230 /// 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)
229232 /// </summary>
230233 /// <param name="handler">Func called for each invocation of the Lambda function.</param>
231234 /// <returns>A HandlerWrapper</returns>
@@ -240,7 +243,7 @@ public static HandlerWrapper GetHandlerWrapper(Func<Stream, ILambdaContext, Task
240243 /// <summary>
241244 /// Get a HandlerWrapper that will call the given method on function invocation.
242245 /// 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)
244247 /// </summary>
245248 /// <param name="handler">Func called for each invocation of the Lambda function.</param>
246249 /// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -257,7 +260,7 @@ public static HandlerWrapper GetHandlerWrapper<TInput>(Func<TInput, ILambdaConte
257260 /// <summary>
258261 /// Get a HandlerWrapper that will call the given method on function invocation.
259262 /// 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()
261264 /// </summary>
262265 /// <param name="handler">Func called for each invocation of the Lambda function.</param>
263266 /// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -279,7 +282,7 @@ public static HandlerWrapper GetHandlerWrapper<TOutput>(Func<Task<TOutput>> hand
279282 /// <summary>
280283 /// Get a HandlerWrapper that will call the given method on function invocation.
281284 /// 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)
283286 /// </summary>
284287 /// <param name="handler">Func called for each invocation of the Lambda function.</param>
285288 /// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -301,7 +304,7 @@ public static HandlerWrapper GetHandlerWrapper<TOutput>(Func<Stream, Task<TOutpu
301304 /// <summary>
302305 /// Get a HandlerWrapper that will call the given method on function invocation.
303306 /// 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)
305308 /// </summary>
306309 /// <param name="handler">Func called for each invocation of the Lambda function.</param>
307310 /// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -324,7 +327,7 @@ public static HandlerWrapper GetHandlerWrapper<TInput, TOutput>(Func<TInput, Tas
324327 /// <summary>
325328 /// Get a HandlerWrapper that will call the given method on function invocation.
326329 /// 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)
328331 /// </summary>
329332 /// <param name="handler">Func called for each invocation of the Lambda function.</param>
330333 /// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -346,7 +349,7 @@ public static HandlerWrapper GetHandlerWrapper<TOutput>(Func<ILambdaContext, Tas
346349 /// <summary>
347350 /// Get a HandlerWrapper that will call the given method on function invocation.
348351 /// 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)
350353 /// </summary>
351354 /// <param name="handler">Func called for each invocation of the Lambda function.</param>
352355 /// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -368,7 +371,7 @@ public static HandlerWrapper GetHandlerWrapper<TOutput>(Func<Stream, ILambdaCont
368371 /// <summary>
369372 /// Get a HandlerWrapper that will call the given method on function invocation.
370373 /// 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)
372375 /// </summary>
373376 /// <param name="handler">Func called for each invocation of the Lambda function.</param>
374377 /// <param name="serializer">ILambdaSerializer to use when calling the handler</param>
@@ -719,6 +722,9 @@ public static HandlerWrapper GetHandlerWrapper<TInput, TOutput>(Func<TInput, ILa
719722 #region IDisposable Support
720723 private bool disposedValue = false ; // To detect redundant calls
721724
725+ /// <summary>
726+ /// Dispose the HandlerWrapper
727+ /// </summary>
722728 protected virtual void Dispose ( bool disposing )
723729 {
724730 if ( ! disposedValue )
@@ -732,6 +738,9 @@ protected virtual void Dispose(bool disposing)
732738 }
733739 }
734740
741+ /// <summary>
742+ /// Dispose the HandlerWrapper
743+ /// </summary>
735744 public void Dispose ( )
736745 {
737746 Dispose ( true ) ;
0 commit comments