"Write a function that does not return until some channel event occurs." Is this а pure function or it has side effects (network call, etc) ? If it's a pure function you can look into core.async transducers.
You can achieve the effect of not returning immediately by putting your logic inside of a (go ...) block. Inside (go ...) <! and >! give the illusion of threads by "parking" and not returning immediately (of course no real threads involved). I still believe that with the approach that I outlined before you can achieve a good effect but maybe I'm misunderstanding. Maybe some more actual code with examples can clarify. On Saturday, May 4, 2019 at 1:24:51 AM UTC-7, Tom Locke wrote: > > I don't think this addresses the issue. > > I'll try to state the problem more simply: > > Write a function that does not return until some channel event occurs. > > (The difficulty being that go, put! and take! all return immediately) > > I would argue the ability to do so is: > > - fundamentally important for interfacing with JS libraries > - not possible with the existing core.async API > - not difficult to implement, but needs to coordinate with the > scheduler > > > -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/clojurescript.
