On Sun, Sep 21, 2014 at 10:08 PM, Sean Corfield <s...@corfield.org> wrote:

>
Hi Sean,

Sorry, I don't really understood your suggestion... But let me try to make
myself more clear of what I'm trying to accomplish:

First let me say that I have a more Javascript background than Java, and my
issue is more into ClojureScript world

Javascript has a lot of async issues, specially when you are working on
Node.JS world, every IO operation is async, although they have sync
versions those versions block the world so I need to keep away from then,
so, async callbacks is my only real options here.

The first thing that I like to do in my async code is to wrap than into
something that I can handle generically, in JS I used to do a lot of
promises code, but now I'm core async, so I think making then "single
channel value" just fits nice, and wrapping that way I can compose very
well.

Now I'm at this place, I have all those async functions that I wanna use to
process my data, I wanna use those async functions, also regular functions.

Before transducers, I've used the David Nolen's reactive helpers (on his
blog source) to do my data processing using those channels, a good example
on how I used to manage complex async pipelines are like this:

(->> (scan-path "root/path") ; this will produce a channel that will output
every file/dir path recursive from given path
     (r/filter-async is-file?)  ; this requires async call to filter
     (f/filter (match-extension? #{"avi" "mpg"})) ; this will just check on
the name, no async required
     (r/map-async read-hash-info) ; another async call, will generate a
hash info from the path
     (r/map #(hash-map :hash %)) ; build a map from the value
     )

So, I like how the previous code is build, because I can really just
composed from my simple sync and async functions, but all these use "custom
transducers" you can say...

Then comes Transducers that can rise the bar on the abstraction level, so I
now can get rid of all those custom transducers, right?

So, it just would be nice if I could get the same clean way to build my
pipeline like I did before, but with transducers.

---
Wilker LĂșcio
http://about.me/wilkerlucio/bio
Woboinc Consultant
+55 81 82556600

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to