anmonteiro / aws-lambda-ocaml-runtime

An OCaml custom runtime for AWS Lambda and Vercel
BSD 3-Clause "New" or "Revised" License
207 stars 8 forks source link

Async handlers #4

Closed anmonteiro closed 5 years ago

anmonteiro commented 5 years ago

currently Lambda_runtime.start is: (Yojson.Safe.json -> Context.t -> (Yojson.Safe.json, string) result) -> unit

I think we might need to provide a Lambda_runtime.start_async or start_io that is:

(Yojson.Safe.json -> Context.t -> (Yojson.Safe.json, string) result Io.t) -> unit

where Io.t is either Lwt.t or Async.Deferred.t

to allow for async handlers.