-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap
executable file
·34 lines (25 loc) · 1.06 KB
/
bootstrap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/opt/picoLisp/bin/picolisp /opt/picoLisp/lib.l
# Local variables:
# mode: picolisp
# eval: (paredit-mode +1)
# End:
(load "@lib/misc.l" "@lib/http.l" "@json/json.l" "@awscurl/libawscurl.l" "@runtime.l")
# When an error occurs, print it out and notify the runtime API
(de main ()
(loop
(cd *Lambda_task_root)
(let (Script (get-script-name *Lambda_task_root *Handler)
Function (get-function-name *Handler)
Temp (make-temp)
Event_data (get-event-data (pack "http://" *Aws_lambda_runtime_api "/2018-06-01/runtime/invocation/next") Temp)
Headers (parse-headers (in Temp (till NIL T))) )
(setq *Request_id (get-request-id Headers))
(finally
(call 'rm Temp)
# Load script, run the function and send the response to the runtime API
(load Script)
(send-response (pack "http://" *Aws_lambda_runtime_api "/2018-06-01/runtime/invocation/" *Request_id "/response")
(eval-function Function Event_data Headers) ) ) ) ) )
(init-runtime)
(main)
(bye)