Exemple #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);
 }
 /// <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);
 }
Exemple #3
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)
 {
 }
Exemple #4
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>
 /// <returns></returns>
 public LambdaBootstrap(HttpClient httpClient, LambdaBootstrapHandler handler, LambdaBootstrapInitializer initializer = null)
     : this(httpClient, handler, initializer, ownsHttpClient : false)
 {
 }
Exemple #5
0
 private HandlerWrapper(LambdaBootstrapHandler handler)
 {
     Handler = handler;
 }