Integrates the Clojure code with two different runtimes: Java Lambda Runtime, Native Provided Runtime. The former is the Official Java Runtime for AWS Lambda which is well tested and works perfectly fine, but it's rather slow due to cold starts whereas, the latter is a custom runtime integrated within the framework. It's a significantly faster than the Java runtime due to the use of GraalVM.
Integrates the Clojure code with two different runtimes: Java Lambda Runtime, Native Provided Runtime. The former is the Official Java Runtime for AWS Lambda which is well tested and works perfectly fine, but it's rather slow due to cold starts whereas, the latter is a custom [runtime](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html) integrated within the framework. It's a significantly faster than the Java runtime due to the use of GraalVM.
(deflambda name doc-string? <mixin-sign? mixin? [request] fn-body)
Convenience macro for generating defn alike lambdas.
Usage:
(i/definterceptor LogIncomingRequest
{:enter (fn [request] request)})
(h/deflambda ExampleLambda
"I can run on both Java and Native..."
< {:interceptors [LogIncomingRequest]}
[{:keys [event ctx]}]
(hr/text "Hello world"))
Convenience macro for generating defn alike lambdas. Usage: ``` (i/definterceptor LogIncomingRequest {:enter (fn [request] request)}) (h/deflambda ExampleLambda "I can run on both Java and Native..." < {:interceptors [LogIncomingRequest]} [{:keys [event ctx]}] (hr/text "Hello world")) ```
(merge-mixins & mixins)
Merges multiple mixins all together.
Usage:
(definterceptor ExampleInterceptor1
{:leave (fn [response] (hr/origin response "*"))
:enter (fn [request] (println "I will log a request" request) request)})
(definterceptor ExampleInterceptor2
{:leave (fn [response] (hr/origin response "*"))
:enter (fn [request] (println "I will log a request" request) request)})
(def mixin1 {:interceptors [ExampleInterceptor1]})
(def mixin2 {:interceptors [ExampleInterceptor2]})
(def mixin3 (merge-mixins mixin1 mixin2)) ;; => {:interceptors [ExampleInterceptor1 ExampleInterceptor2]}
Merges multiple mixins all together. Usage: ``` (definterceptor ExampleInterceptor1 {:leave (fn [response] (hr/origin response "*")) :enter (fn [request] (println "I will log a request" request) request)}) (definterceptor ExampleInterceptor2 {:leave (fn [response] (hr/origin response "*")) :enter (fn [request] (println "I will log a request" request) request)}) (def mixin1 {:interceptors [ExampleInterceptor1]}) (def mixin2 {:interceptors [ExampleInterceptor2]}) (def mixin3 (merge-mixins mixin1 mixin2)) ;; => {:interceptors [ExampleInterceptor1 ExampleInterceptor2]} ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close