Fork me on GitHub
#aleph
<
2018-08-13
>
fantomofdoom15:08:15

Hi, smb use manifold (https://github.com/ztellman/manifold), i can't find how create something like core.async go-loop only for manifold stream? (and smb known if use manifold.deffered/loop & recur, thread are parked or it alway take message from source)

mccraigmccraig18:08:29

@fantomofdoom what exactly do you want to do ? lots of stream ops can be done with stream/map and stream/reduce. occasionally you need some finer control and then deferred/loop and deferred/recur may be useful e.g. https://github.com/ztellman/manifold/blob/master/src/manifold/stream.clj#L232

mccraigmccraig18:08:13

i haven't yet come across any stream solution i couldn't express with some combination of those ops

fantomofdoom18:08:54

@mccraigmccraig Hi, i need smth like this >in core.async

(go-loop []
    SOME WORK
      (>! out-ch processed-msg)
    (recur))
i need infinity loop that get msg from channel process and push forward

mccraigmccraig18:08:58

@fantomofdoom that's a stream/map ... if you look at the impl you can see it uses the lower-level connect primitives to do pretty much what you are doing in your go loop - https://github.com/ztellman/manifold/blob/master/src/manifold/stream.clj#L614