Method: Jets::PolyFun::PythonExecutor#code
- Defined in:
- lib/jets/poly_fun/python_executor.rb
#code ⇒ Object
Code for wrapper script that mimics lambda execution. Wrapper script usage:
python WRAPPER_SCRIPT EVENT
Example:
python /tmp/jets/demo/executor/20180804-12816-imqb9/lambda_executor.py '{}'
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/jets/poly_fun/python_executor.rb', line 10 def code <<-EOL import sys import json from #{@task.meth} import #{handler} event = json.loads(sys.argv[1]) context = {} resp = #{handler}(event, context) result = json.dumps(resp) print(result) EOL end |