Class: Jets::Job::Base
Instance Attribute Summary
#context, #event, #meth
Class Method Summary
collapse
#sqs_event_payload
#sns_event_payload
#s3_event, #s3_object
#log_event
#kinesis_data
inherited, #initialize, output_keys, subclasses
#lambda_functions
Class Method Details
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/jets/job/base.rb', line 34
def perform_later(meth, event={}, context={})
if on_lambda?
function_name = "#{self.to_s.underscore}-#{meth}"
call = Jets::Commands::Call.new(function_name, JSON.dump(event), invocation_type: "Event")
call.run
else
puts "INFO: Not on AWS Lambda. In local mode perform_later executes the job with perform_now instead."
perform_now(meth, event, context)
end
end
|
30
31
32
|
# File 'lib/jets/job/base.rb', line 30
def perform_now(meth, event={}, context={})
new(event, context, meth).send(meth)
end
|
.process(event, context, meth) ⇒ Object
25
26
27
28
|
# File 'lib/jets/job/base.rb', line 25
def process(event, context, meth)
job = new(event, context, meth)
job.send(meth)
end
|