Fork me on GitHub
#duct
<
2018-05-30
>
scaturr01:05:06

Deploying to heroku was a snap, but I’m trying to get wild and deploy to AWS Lambda - and I feel like what I need is a handler with resolved dependencies - if there is such a thing

scaturr01:05:30

I was thinking I could do something like (ig/init config [:duct.core/handler])

scaturr01:05:48

But that does not appear to be a handler I can invoke with a request

weavejester01:05:55

I haven’t actually used AWS Lambda so I’m not sure what’s involved.

scaturr01:05:41

The code snippet in that section may be a good indicator?

scaturr02:05:26

certainly not a show stopper for many, but the price tag for lambda is too appealing 🙂

scaturr02:05:57

as I figure out my way around duct, I would love to write up a module or something to give back

weavejester02:05:05

You could probably do something like:

(deflambdafn blah [in out ctx]
  (:foo.lambda/blah (ig/init config [:foo.lambda/blah])))

weavejester02:05:37

But perhaps there’s a way of ensuring that the config doesn’t need to be reinitialised?

weavejester02:05:07

Something to investigate I guess. Lambda functions don’t appear to be directly compatible with Ring handlers.

scaturr02:05:56

I will keep digging! Thank you

weavejester02:05:37

(let [f (:foo.lambda/blah (ig/init config [:foo.lambda/blah]))]
  (deflambdafn ...

weavejester02:05:49

Perhaps it works with a let? No idea 🙂

scaturr02:05:47

would an atom work? store the result of (ig/init)?

weavejester02:05:18

Yeah, you could cache it? But a let might be a better idea…

scaturr02:05:32

Awesome - that gives me something to go on

scaturr02:05:44

Thank you so much