コード例 #1
0
 /// <summary>
 /// Create a LambdaBootstrap that will call the given initializer and handler.
 /// </summary>
 /// <param name="httpClient">The HTTP client to use with the Lambda runtime.</param>
 /// <param name="handler">Delegate called for each invocation of the Lambda function.</param>
 /// <param name="initializer">Delegate called to initialize the Lambda function.  If not provided the initialization step is skipped.</param>
 /// <param name="ownsHttpClient">Whether the instance owns the HTTP client and should dispose of it.</param>
 /// <returns></returns>
 private LambdaBootstrap(HttpClient httpClient, LambdaBootstrapHandler handler, LambdaBootstrapInitializer initializer, bool ownsHttpClient)
 {
     _httpClient         = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
     _handler            = handler ?? throw new ArgumentNullException(nameof(handler));
     _ownsHttpClient     = ownsHttpClient;
     _initializer        = initializer;
     _httpClient.Timeout = RuntimeApiHttpTimeout;
     Client = new RuntimeApiClient(new SystemEnvironmentVariables(), _httpClient);
 }
コード例 #2
0
 /// <summary>
 /// Create a LambdaBootstrap that will call the given initializer and handler.
 /// </summary>
 /// <param name="handler">Delegate called for each invocation of the Lambda function.</param>
 /// <param name="initializer">Delegate called to initialize the Lambda function.  If not provided the initialization step is skipped.</param>
 /// <returns></returns>
 public LambdaBootstrap(LambdaBootstrapHandler handler, LambdaBootstrapInitializer initializer = null)
 {
     _handler     = handler ?? throw new ArgumentNullException(nameof(handler));
     _initializer = initializer;
     _httpClient  = new HttpClient
     {
         Timeout = RuntimeApiHttpTimeout
     };
     Client = new RuntimeApiClient(new SystemEnvironmentVariables(), _httpClient);
 }
コード例 #3
0
 /// <summary>
 /// Create a LambdaBootstrap that will call the given initializer and handler.
 /// </summary>
 /// <param name="httpClient">The HTTP client to use with the Lambda runtime.</param>
 /// <param name="handlerWrapper">The HandlerWrapper to call for each invocation of the Lambda function.</param>
 /// <param name="initializer">Delegate called to initialize the Lambda function.  If not provided the initialization step is skipped.</param>
 /// <returns></returns>
 public LambdaBootstrap(HttpClient httpClient, HandlerWrapper handlerWrapper, LambdaBootstrapInitializer initializer = null)
     : this(httpClient, handlerWrapper.Handler, initializer, ownsHttpClient : false)
 {
 }
コード例 #4
0
 /// <summary>
 /// Create a LambdaBootstrap that will call the given initializer and handler.
 /// </summary>
 /// <param name="handlerWrapper">The HandlerWrapper to call for each invocation of the Lambda function.</param>
 /// <param name="initializer">Delegate called to initialize the Lambda function.  If not provided the initialization step is skipped.</param>
 /// <returns></returns>
 public LambdaBootstrap(HandlerWrapper handlerWrapper, LambdaBootstrapInitializer initializer = null)
     : this(handlerWrapper.Handler, initializer)
 {
 }
コード例 #5
0
 /// <summary>
 /// Create a LambdaBootstrap that will call the given initializer and handler.
 /// </summary>
 /// <param name="handler">Delegate called for each invocation of the Lambda function.</param>
 /// <param name="initializer">Delegate called to initialize the Lambda function.  If not provided the initialization step is skipped.</param>
 /// <returns></returns>
 public LambdaBootstrap(LambdaBootstrapHandler handler, LambdaBootstrapInitializer initializer = null)
     : this(ConstructHttpClient(), handler, initializer, ownsHttpClient : true)
 {
 }
コード例 #6
0
 /// <summary>
 /// Configure a custom bootstrap initalizer delegate
 /// </summary>
 /// <param name="lambdaBootstrapInitializer"></param>
 /// <returns></returns>
 public LambdaBootstrapBuilder UseBootstrapHandler(LambdaBootstrapInitializer lambdaBootstrapInitializer)
 {
     _lambdaBootstrapInitializer = lambdaBootstrapInitializer;
     return(this);
 }