Fork me on GitHub
#yada
<
2016-02-25
>
stijn08:02:19

@mccraigmccraig: i found a solution that increases the number of processes calling asynchronous functions, although I'm not really sure I totally understand manifolds execution models simple_smile

stijn08:02:43

(defn pipeline-async
  [n f in]
  (let [out (s/stream n)]
    (s/connect (s/map f in) out)
    (s/realize-each out)))

stijn08:02:00

(->> (stream/->source (range 100))
     (pipeline-async 10 get-stuff)
     (stream/stream->seq))

stijn08:02:38

what I don't understand is, how does manifold.deferred/future turn a blocking IO operation into something where a callback can be attached?

stijn08:02:39

> Wherever possible, use manifold.deferred/deferred instead of promise, and manifold.deferred/future instead of future. They will behave identically to their Clojure counterparts (deliver can be used on a Manifold deferred, for instance), but allow for callbacks to be registered, so no additional threads are required.

malcolmsparks10:02:09

You could have reasonably expected yada to return byte[] to aleph. Until now, it hasn't! Thanks to Andy Dwelly for spotting this - not quite sure why I'd never thought to do so before now

imre11:02:10

hey @malcolmsparks here's another PR for coercing keyword values from a json body: https://github.com/juxt/yada/pull/67

imre15:02:01

thanks for the merge!

imre16:02:30

question to folks here: has anyone of you created file upload endpoints with yada?