Class: ElasticGraph::WarehouseLambda::LambdaFunction

Inherits:
Object
  • Object
show all
Includes:
LambdaSupport::LambdaFunction
Defined in:
lib/elastic_graph/warehouse_lambda/lambda_function.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLambdaFunction

Returns a new instance of LambdaFunction.



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/elastic_graph/warehouse_lambda/lambda_function.rb', line 21

def initialize
  require "elastic_graph/warehouse_lambda"
  require "elastic_graph/indexer_lambda/sqs_processor"

  warehouse_lambda = WarehouseLambda.warehouse_lambda_from_env
  ignore_sqs_latency_timestamps_from_arns = ::JSON.parse(ENV.fetch("IGNORE_SQS_LATENCY_TIMESTAMPS_FROM_ARNS", "[]")).to_set

  @sqs_processor = IndexerLambda::SqsProcessor.new(
    warehouse_lambda.processor,
    ignore_sqs_latency_timestamps_from_arns: ignore_sqs_latency_timestamps_from_arns,
    logger: warehouse_lambda.logger
  )
end

Instance Attribute Details

#sqs_processorObject (readonly)

Returns the value of attribute sqs_processor.



19
20
21
# File 'lib/elastic_graph/warehouse_lambda/lambda_function.rb', line 19

def sqs_processor
  @sqs_processor
end

Instance Method Details

#handle_request(event:, context:) ⇒ Object



35
36
37
# File 'lib/elastic_graph/warehouse_lambda/lambda_function.rb', line 35

def handle_request(event:, context:)
  sqs_processor.process(event)
end