Class: AwsLambdaRIC::Bootstrap
- Inherits:
-
Object
- Object
- AwsLambdaRIC::Bootstrap
- Defined in:
- lib/aws_lambda_ric.rb
Instance Method Summary collapse
Instance Method Details
#bootstrap_handler ⇒ Object
211 212 213 214 215 216 217 218 219 220 |
# File 'lib/aws_lambda_ric.rb', line 211 def bootstrap_handler if ENV['_HANDLER'] == nil puts 'No handler specified, exiting Runtime Interface Client.' exit end app_root = Dir.pwd handler = ENV['_HANDLER'] lambda_runner = AwsLambdaRIC::LambdaRunner.new(fetch_runtime_server, AwsLambdaRIC::get_user_agent) lambda_runner.run(app_root, handler) end |
#fetch_runtime_server ⇒ Object
204 205 206 207 208 209 |
# File 'lib/aws_lambda_ric.rb', line 204 def fetch_runtime_server ENV.fetch(AwsLambdaRIC::LambdaRunner::ENV_VAR_RUNTIME_API) rescue KeyError puts 'Failed to get runtime server address from AWS_LAMBDA_RUNTIME_API env variable' exit(-2) end |
#start ⇒ Object
199 200 201 202 |
# File 'lib/aws_lambda_ric.rb', line 199 def start AwsLambdaRIC::TelemetryLogger::from_env() bootstrap_handler end |