aws-lambda

borkdude 2020-03-22T10:53:15.018200Z

OK, thanks. I'll await your results.

borkdude 2020-03-22T10:54:37.018400Z

I think it might also be good to post an issue about this to oracle/graal, since it seems they intended to fix the issue

borkdude 2020-03-22T10:55:04.018600Z

instead of us working around it

borkdude 2020-03-22T11:00:20.018800Z

commented here now: https://github.com/oracle/graal/issues/841#issuecomment-602181005

2020-03-22T18:08:03.019200Z

I've tried with try/catch. The same failure.

borkdude 2020-03-22T18:19:01.019400Z

ok, then our decision was good

2020-03-22T21:15:58.019600Z

It turns out that lambda runtime has curl. So no external dependencies needed. Then the issue is to parse curl response with headers. @borkdude do you plan to support parsing curl response into {:headers {} :body "" :ect :etc} in babashka.curl?

borkdude 2020-03-22T21:28:54.019800Z

@dainius.jocas Cool. I think it's good to have support for this, but it's not currently implemented.

2020-03-22T21:32:24.020Z

Another issue with using curl is that it is much much slower, than clj-http-lite. The echo took 200ms consistently to execute while clj-http-lite take 15ms. Here is my naive implementation of curl response parsing https://gist.github.com/dainiusjocas/d2a5ca60ae25cd260f37b7c125a0b2e6

borkdude 2020-03-22T21:33:33.020400Z

why would curl be slower you think?

borkdude 2020-03-22T21:40:12.020600Z

I made an issue for parsing the headers here: https://github.com/borkdude/babashka.curl/issues/5 I think this should be optional, so maybe when passed an option like :response true will return the full response map and when it's not set, it will return only the body?

2020-03-22T21:48:24.021Z

no idea why it could be that much slower.

2020-03-22T21:51:43.021200Z

IMO, the current functionality should not change, so this response parsing should under some new param like :response true. Note that response headers are retrieved with :raw-args ["-i"]

borkdude 2020-03-22T21:58:33.021400Z

yeah, so when :response true, use the "-i" argument implicitly

2020-03-22T22:18:16.021600Z

👍

borkdude 2020-03-22T22:52:21.021800Z

FWIW I see similar times between babashka.curl and slurp

user=&gt; (time (do (curl/get "<https://www.clojure.org>") nil))
"Elapsed time: 75.406528 msecs"
nil
user=&gt; (time (do (slurp "<https://www.clojure.org>") nil))