iopipe / turtle

Turtle - functional composition for building lambda architectures in NodeJS
Apache License 2.0
153 stars 9 forks source link

Support Promises in iopipe.define() #82

Open ewindisch opened 8 years ago

ewindisch commented 8 years ago

Users would like to return a promise from functions passed to iopipe.define

Dustin Getz @dustingetz Jul 02 14:16
hey guys cool project
I thought aws lambda can't do async or state, i thought you just had to compute something and return a value, am i confused?
let inc = (e,c)=>resovledPromise(e.count+1)
iopipe.define(inc, inc, inc)
is this possible to express?
with async types
i now see it can here: https://github.com/iopipe/dockaless-examples/blob/master/functions/urls-ffmpeg-resize/index.js
ewindisch commented 8 years ago

WIP tree: https://github.com/ewindisch/iopipe/tree/i_promise_you

ewindisch commented 8 years ago

/cc @dustingetz (requested this via gitter.im)